|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-05-02 13:42 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 12:00:01 2025 UTC |
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 )