|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-08-24 22:09 UTC] derick@php.net
[2005-08-30 14:21 UTC] tuft at centrum dot cz
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 02:00:01 2025 UTC |
Description: ------------ when I call "$variable = $this" inside the class it will create only reference, it won't create new instance of object(it behave exactly like "$variable = &$this" should behave) and "$variable = &$this" don't do anything. Reproduce code: --------------- class A { var $t = "Original <br>"; function A() { global $active; $active = $this; } function test(){echo $this->t;} } function f() { global $active; $active->t = "Changed <br>"; $active->test(); } $a = new A(); $a->test(); f(); $a->test(); Expected result: ---------------- Original Changed Original Actual result: -------------- Original Changed Changed