|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43521 Problem with Variant/Parameters
Submitted: 2007-12-06 16:25 UTC Modified: 2021-04-18 04:22 UTC
Avg. Score:4.6 ± 0.8
Reproduced:10 of 10 (100.0%)
Same Version:2 (20.0%)
Same OS:6 (60.0%)
From: oespeter at gravityshock dot biz Assigned: cmb (profile)
Status: No Feedback Package: COM related
PHP Version: 5.2.5 OS: Win2k; Win2003 Server
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
14 - 6 = ?
Subscribe to this entry?

 [2007-12-06 16:25 UTC] oespeter at gravityshock dot biz
Hi, I have problems fetching data from an special database over a com-based sdk. With VisualBasic it's not a problem, but the same code doesn't work with php. Some folks (lists/forums) said it may be an bug in the COM-Extension of PHP.
The error occurs with a COM based SDK (called PI-SDK from OsiSoft Inc.). I can work via COM with all functions that need no parameters. But most of the functions that need params didn't work with php. With VisualBasic it works without problems. I testet with PHP 5.2.2/3/4/5 (snaps and, 5.3.0-dev(snap from today).

Reproduce code:
Because of comercial licence ist not reproducible for the comunity :-/
//Following works fine:
$comObjPi = new COM('PISDK.PISDK');
$server = $comObjPi->Servers->Item("");
$point = $server->PIPoints("SINUSOID");
echo "\n Last value: ".$point->Data->SnapShot()->Value."\n";
echo "\n Last Timestamp: ".$point->Data->SnapShot()->TimeStamp."\n";
//the following throws exceptions:
  $value = $point->Data->ArcValue(new Variant(mktime(), VT_R8), rtBefore);
  echo "\n Value before now (last value): ".$point->Data->SnapShot()->Value."\n";
} catch(Exception $e){
  print("\nException ".$e->getMessage()." TraceString:".$e->getTraceAsString());

Expected result:
Last value: 47.11
Last Timestamp: 123456789
Value before now (last value): 47.11

Actual result:
Last value: 47.11
Last Timestamp: 123456789
Exception Parameter 0: Typkonflikt.  //Type-Mismatch in the english
 TraceString: #0 C:\php_pi\pitest.php(10): variant->ArcValue(Object(variant), 6)
#1 {main}


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-04-06 11:24 UTC]
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-04-06 11:24 UTC]
mktime() returns an integer (32bit on x86), and so the conversion
to VT_R8 might fail, or maybe ArcValue() doesn't accept a VT_R8.
But anyhow, there may not be the need to pass a variant; wouldn't
it work if you pass the return value of mktime() directly?
 [2021-04-18 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Sep 19 08:03:37 2021 UTC