Bug #51206 [Opn]: PHP4 works, PHP5 says "this variant has no properties"

From: Date: Sat, 13 Mar 2010 19:39:38 +0000
Subject: Bug #51206 [Opn]: PHP4 works, PHP5 says "this variant has no properties"
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-148592@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=51206&edit=1

 ID:               51206
 Updated by:       ksingla@php.net
 Reported by:      zelnaga at gmail dot com
 Summary:          PHP4 works, PHP5 says "this variant has no properties"
 Status:           Open
 Type:             Bug
 Package:          COM related
 Operating System: Windows XP
 PHP Version:      5.3.1

 New Comment:

$variant->type and $variant->value syntax is not supported in PHP5. See
http://www.php.net/manual/en/class.variant.php
for more details.

Doesn't seem like there is a way to print an array of variants in php5.
Bug 35956 also talks about this problem.


Previous Comments:
------------------------------------------------------------------------
[2010-03-04 22:48:41] zelnaga at gmail dot com

Description:
------------
Test script works, as expected, under PHP4.  Gives nonsensical error
under PHP5.

Test script:
---------------
<?php
$registry = new COM('winmgmts:root/DEFAULT:StdRegProv');
$values = new VARIANT();
echo $registry->getBinaryValue(0x80000002,
'SOFTWARE\\Microsoft\\Cryptography\\RNG', 'Seed', $values);
var_dump($values->value);
?>

Expected result:
----------------
From PHP4:

array(80) {
  [0]=>
  int(105)
  [1]=>
  int(144)
  [2]=>
  int(158)
  [3]=>
  int(99)
  [4]=>
  int(155)
  [5]=>
  int(55)
  [6]=>
  int(130)
  [7]=>
  int(185)
  [8]=>
  int(210)
  [9]=>
  int(60)
  [10]=>
  int(182)
  [11]=>
  int(200)
  [12]=>
  int(170)
  [13]=>
  int(52)
  [14]=>
  int(34)
  [15]=>
  int(86)
  [16]=>
  int(17)
  [17]=>
  int(147)
  [18]=>
  int(100)
  [19]=>
  int(212)
  [20]=>
  int(205)
  [21]=>
  int(146)
  [22]=>
  int(243)
  [23]=>
  int(102)
  [24]=>
  int(17)
  [25]=>
  int(159)
  [26]=>
  int(193)
  [27]=>
  int(252)
  [28]=>
  int(189)
  [29]=>
  int(83)
  [30]=>
  int(143)
  [31]=>
  int(51)
  [32]=>
  int(183)
  [33]=>
  int(3)
  [34]=>
  int(48)
  [35]=>
  int(46)
  [36]=>
  int(102)
  [37]=>
  int(73)
  [38]=>
  int(210)
  [39]=>
  int(237)
  [40]=>
  int(13)
  [41]=>
  int(244)
  [42]=>
  int(194)
  [43]=>
  int(117)
  [44]=>
  int(254)
  [45]=>
  int(234)
  [46]=>
  int(166)
  [47]=>
  int(147)
  [48]=>
  int(104)
  [49]=>
  int(192)
  [50]=>
  int(211)
  [51]=>
  int(117)
  [52]=>
  int(50)
  [53]=>
  int(148)
  [54]=>
  int(253)
  [55]=>
  int(148)
  [56]=>
  int(237)
  [57]=>
  int(85)
  [58]=>
  int(70)
  [59]=>
  int(242)
  [60]=>
  int(32)
  [61]=>
  int(159)
  [62]=>
  int(38)
  [63]=>
  int(182)
  [64]=>
  int(211)
  [65]=>
  int(36)
  [66]=>
  int(205)
  [67]=>
  int(115)
  [68]=>
  int(212)
  [69]=>
  int(117)
  [70]=>
  int(40)
  [71]=>
  int(249)
  [72]=>
  int(102)
  [73]=>
  int(67)
  [74]=>
  int(100)
  [75]=>
  int(147)
  [76]=>
  int(236)
  [77]=>
  int(194)
  [78]=>
  int(241)
  [79]=>
  int(28)
}

Actual result:
--------------
From PHP5:

Fatal error: Uncaught exception 'com_exception' with message 'this
variant has no properties' in C:\php\test.php:5 Stack trace: #0
C:\php\test.php(5): unknown() #1 {main} thrown in C:\php\test.php on
line 5


------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=51206&edit=1


Thread (3 messages)

« previous php.bugs (#148592) next »