Hi have found an interesting behaviour, watch below...
1)
$foobar->rfoo=&$a;
$foobar->r2foo=&$foobar->rfoo;
$foobar->rfoo=4;
What are we assigning 4 here to? The first question is, should we allow
this? I think no, references to non-existing variables should be
disallowed (although Zend allows a lot, this is no good).
This is not even a reference to a variable, which could have been
magically created, named ${''} or another undefined variable, let's say
$b...
2)
I tried to simply do a
echo $a;
afterwards and wow!!! It works, sometimes! Intermittently PHP crashes,
without reasons, in this case I put this code below by accident
function strlens($string) { return $string; }
ob_start('strlens');
echo '<PRE>';
var_dump($foobar);
echo '</PRE>';
ob_end_flush();
I do not know what this crash relates to what made me assuming Zend
randomly corrupted some memory using this undefined behaviour? If I put
a die() below the echo it works in any case...
+1 disallowing this or modifying behaviour that it does nothing or
anything else but referencing to nirvana
andré
--
· André Langhorst t: +49 331 5811560 ·
· [EMAIL PROTECTED] m: +49 173 9558736 ·
* PHP Quality Assurance http://qa.php.net *
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]