Re: serializing references, almost without modifications

From: Date: Wed, 19 Jul 2000 13:00:13 +0000
Subject: Re: serializing references, almost without modifications
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-25081@lists.php.net to get a copy of this message
$a = 1; $b =& $a; $b = 2;
$b points to the adress of $a, should not be different from other languages... $b and $a are completely equally stored then in memory then? not they aren´t, cos I can do... $obj->foo=1; $obj2->foo=&$obj->foo; var_dump($obj); result in: object(stdClass)(1) { ["foo"]=> int(1) } var_dump($obj2); results in: object(stdClass)(1) { ["foo"]=> &int(1) } how does var_dump() than that´s reference, following you words it should not know this. again, if var_dump() can retrieve this info, a function ref_dump() could find that variable in memory which is *not* a reference and then serialize: object(stdClass)(1) { ["foo"]=> int(1) } and object(stdClass)(1) { ["foo"]=> reference(obj->foo) } regards -- o----------0-¬---------O-·---¬----o---®-----o o O ° . | http://www.kiffen.de | pRoteçt y0ur bRaín |0 O ° ¤ ° · 0°·³°²'²³-¹'³´³°^°³~³²³°'³²²¨³²^³¹³²°²³`³º³°Þ ° o © ° . · | psychedelic experience | gott@kiffen.de | O ° o ° o-¬--o--0-----©-·--O-----o-----0-¤----------o 0 ° · ° . ¤ ·

« previous php.dev (#25081) next »