|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-01-08 13:41 UTC] nikic@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: nikic
[2020-01-08 13:41 UTC] nikic@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 13:00:02 2025 UTC |
Description: ------------ Object oriented concept not work when i use pointer(&) on static variable.Static variable of Parent and child class has diffrent value at same time Test script: --------------- class a1{ public static $obj=''; } class b1 extends a1{ } class c{ public $forprint='cccObject'; } class d{ public $forprint='dddObject'; } $c=new c(); $d=new d(); b1::$obj=& $d; a1::$obj=& $c; echo b1::$obj->forprint; //out put must be print cccObject but it print dddObject in php Actual result: -------------- dddObject