Re: serializing references, almost without modifications
| From: | Stanislav Malyshev | Date: | Wed, 19 Jul 2000 10:57:46 +0000 |
| Subject: | Re: serializing references, almost without modifications | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-25066@lists.php.net to get a copy of this message | ||
w>> Is it possible to retrieve the information if a variable is a reference
w>> with eg is_reference() from user land? and even better to retrieve to
Theoretically, yes. Practically, you'll get lots of surprises. All
variables declared "global" are "references", for example.
w>> which variable(name) that reference points?
To itself, surely. I say for $N'th time - references are like Unix files,
they do *NOT* point to other variable, they point to variable
contents. Saying $a = &$b means "make a point to the same contents as b
does".
w>> print_r() is able to display references thus it should be possible to
w>> get that information somehow.
well, print_r does not print exactly it's argument. That's a bit more
complicated, as I see.
w>> then one could serialize the information which references points to
w>> which variable in an object separately and after unserializing an object
No. There's no such thing as "reference points to variable", there is a
thing that "reference is an operation which makes two variables point to
the same content".
--
Stanislav Malyshev stas@zend.com
+972-3-6139665