Posted by Andrey Nikolaev on 08/03/05 22:07
I'm not php noobie, but still can't understand this behaviour of references.
Anybody can show me where the hell is it documented ?
Or show any logical conclusions why is it act like this... Just anything.
Thanks.
Description:
------------
See reproduce code.
Reproduce code:
---------------
<?php
class A {}
class RefTest {
function RefTest() {
$this->a = new A;
$this->b =& $this->a;
}
}
$rt = new RefTest();
var_dump($rt);
?>
Expected result:
----------------
object(reftest)(2) {
["a"]=>
object(a)(0) {
}
["b"]=>
&object(a)(0) {
}
}
Actual result:
--------------
object(reftest)(2) {
["a"]=>
&object(a)(0) {
}
["b"]=>
&object(a)(0) {
}
}
Navigation:
[Reply to this message]
|