Re: Memory corruption in Zend, should we allow this?
| From: | Stanislav Malyshev | Date: | Thu, 15 Mar 2001 09:31:18 +0000 |
| Subject: | Re: Memory corruption in Zend, should we allow this? | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-48972@lists.php.net to get a copy of this message | ||
AL>> $foobar->rfoo=&$a;
AL>> $foobar->r2foo=&$foobar->rfoo;
AL>> $foobar->rfoo=4;
AL>>
AL>> What are we assigning 4 here to?
To all three of them, which are all reference-bound.
AL>> The first question is, should we allow this? I think no,
AL>> references to non-existing variables should be disallowed
AL>> (although Zend allows a lot, this is no good).
There's no such thing anyway - when variable needed (inlcuding taking it's
address for referencing) it's created.
AL>> I tried to simply do a
AL>> echo $a;
AL>> afterwards and wow!!! It works, sometimes! Intermittently PHP crashes,
AL>> without reasons, in this case I put this code below by accident
For me, it works each and every time. But I'm on Linux.
--
Stanislav Malyshev, Zend Products Engineer
stas@zend.com http://www.zend.com/ +972-3-6139665 ext.115