|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-07-14 03:14 UTC] kolb0057 at umn dot edu
[2010-07-14 11:47 UTC] mgf@php.net
-Status: Open
+Status: Bogus
[2010-07-14 11:47 UTC] mgf@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 18:00:01 2025 UTC |
Description: ------------ When an object's member is assigned as a reference to a different class' static member and that static member is itself later assigned by reference, the original object member's reference is not being updated. I posted this question to the PHP General Mailing List. One user confirmed the bug for V5.0.0 to V5.3.3RC2. In case you would like to search the archive, the subject of the email was "Static Class Member References". Test script: --------------- <?php class A { public static $a = 3; } class B { public $b; public function assign() { $this->b =& A::$a; } } $b = new B; $a = new A; $b->assign(); A::$a =& $a; var_dump($b->b); // expected: object(A) | result: int 3 ?> Expected result: ---------------- I expect 'var_dump($b->b);' to print: object(A). Actual result: -------------- 'var_dump($b->b);' is actually printing 'int 3'.