PHP 4.0 Bug #9164 Updated: wrong variable is initialized

From: Date: Wed, 07 Feb 2001 21:26:14 +0000
Subject: PHP 4.0 Bug #9164 Updated: wrong variable is initialized
Groups: php.dev 
Request: Send a blank email to php-dev+get-45988@lists.php.net to get a copy of this message
ID: 9164 Updated by: jmoore Reported By: di99otmi@hd.chalmers.se Old-Status: Open Status: Closed Bug Type: Scripting Engine problem Assigned To: Comments: Your code is incorrect, try this: function Bjbase($antal){ $this->lekar=$antal; $this->dragna=array(); $this->ess=58; echo $this->dragna; } Previous Comments: --------------------------------------------------------------------------- [2001-02-07 16:21:44] di99otmi@hd.chalmers.se function Bjbase($antal){ $this->$lekar=$antal; $this->$dragna=array(); $this->$ess=58; echo $this->$dragna; } this is a constructor the echo statement prints 58 even though that it is $ess that is initialized to 58. The variable $dragna is not treated as an array anywhere but when the $ess line is gone it works fine. tried at another server too. is this a problem you know of? --------------------------------------------------------------------------- ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=9164&edit=2

« previous php.dev (#45988) next »