Re: serializing references, almost without modifications
| From: | Wico de Leeuw | Date: | Wed, 19 Jul 2000 13:21:46 +0000 |
| Subject: | Re: serializing references, almost without modifications | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-25086@lists.php.net to get a copy of this message | ||
Hiya
The only way i see when its possible (but very slow i think) is
when you can retieve the addess a the reference is pointing to and the scan all (non reference) variables and search for the var that is pointing to that adress.
Maybe (if it's possible) someone should benchmark how fast (on a slow machiene) you can scan lots of variables and the get (compare) the adress there pointing to
Greetz,
Wico
P.S. could someone please take a look at my bugreport about preg_replace.
At 15:07 19-7-00 +0200, Mathieu Kooiman (ggInternet) wrote:
I have been messing with this reference code.. a zValue struct has a member 'int is_ref'; You're indeed viewing references in the wrong way in this example:$a = "http://www.gginter.net"; $b = &$a;You should see a reference like this:/-------- $a "http://www.gginter.net" \-------- $b_NOT_ like this:$a = "http://www.gginter.net" ------- $b-- CaPS On Wed, 19 Jul 2000, waldschrott wrote:$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 ° · ° . ¤ · -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net