Reference problem... (got bounced from php.bugs #33984)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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) {
  }
}

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux