|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-08-20 03:19 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 04:00:02 2025 UTC |
Description: ------------ A class which contains more than 1 variable, all varible gets the same values. The all get the value of the last value assinging. Reproduce code: --------------- <?php class test { var $a; var $b; function test() { $this->$a = "Hello"; $this->$b = "World!"; } function showWorld() { echo $this->$a." ".$this->$b; } } ?> Expected result: ---------------- After calling showWorld() i would expect to see: "Hello World!". Actual result: -------------- After calling showWorld() i got: "World! World!"