From: dan at yes dot lt
Operating system: winxp
PHP version: 5.0.4
PHP Bug Type: WDDX related
Bug description: wddx_* works incorrectly with objects with private/protected
members
Description:
------------
wddx_* works incorrectly with objects with private/protected members. for
correct behaviour see serialize/unserialize functions.
Reproduce code:
---------------
class Test
{
private $a = 10;
protected $b = true;
public $c = 'test';
}
$src = new Test();
print_r($src);
$wddx = wddx_serialize_value($src);
echo $wddx, "\n";
$dst = wddx_deserialize($wddx);
print_r($dst);
Expected result:
----------------
Test Object
(
[a:private] => 10
[b:protected] => 1
[c] => test
)
<wddxPacket version='1.0'><header/><data><struct><var
name='php_class_name'><string>Test</string></var><var
name='a'><number>10</number></var><var name='b'><boolean
value='true'/></var><var
name='c'><string>test</string></var></struct></data></wddxPacket>
Test Object
(
[a:private] => 10
[b:protected] => 1
[c] => test
)
Actual result:
--------------
Test Object
(
[a:private] => 10
[b:protected] => 1
[c] => test
)
<wddxPacket version='1.0'><header/><data><struct><var
name='php_class_name'><string>Test</string></var><var
name=''><number>10</number></var><var name=''><boolean
value='true'/></var><var
name='c'><string>test</string></var></struct></data></wddxPacket>
Test Object
(
[a:private] => 10
[b:protected] => 1
[c] => test
[0] => 10
[1] => 1
)
--
Edit bug report at http://bugs.php.net/?id=32909&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32909&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=32909&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=32909&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=32909&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=32909&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=32909&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=32909&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=32909&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32909&r=support
Expected behavior: http://bugs.php.net/fix.php?id=32909&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=32909&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=32909&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=32909&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32909&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=32909&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=32909&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32909&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=32909&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=32909&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=32909&r=mysqlcfg