You are here: Reference problem... (got bounced from php.bugs #33984) « PHP « IT news, forums, messages
Reference problem... (got bounced from php.bugs #33984)

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация