PHP 4.0 Bug #7824 Updated: For Loop seems to mis-behave when using classes

From: Date: Wed, 15 Nov 2000 07:59:48 +0000
Subject: PHP 4.0 Bug #7824 Updated: For Loop seems to mis-behave when using classes
Groups: php.dev 
Request: Send a blank email to php-dev+get-38122@lists.php.net to get a copy of this message
ID: 7824 Updated by: zak Reported By: heang.cheng@dingoblue.com.au Status: Bogus Bug Type: Class/Object related Assigned To: Comments: This is not a bug. The cited line has a series of syntax errors in it. To avoid these problems, read the manual entry on variable variables (http://www.php.net/manual/language.variables.variable.php) Note that this will not fix the problem with your first argument (cbowireline.$lineno) If you are trying to call a constant dynamically, you will need to use eval() - if you want to pass a string to the argument, then change the argument to: "cbowireline$lineno" -or- 'cbowireline' . $lineno Previous Comments: --------------------------------------------------------------------------- [2000-11-15 01:49:13] heang.cheng@dingoblue.com.au $fetchwireline = new GetWireline; $fetchwireline->GetWireline($custnumber); $cbophone = new Selectwireline; $cbophone->Wireline($fetchwireline->getsql()); // NEXT THREE LINES DOES NOT WORK for($lineno=1; $lineno <= 2; $lineno++){ $cbophone->Build(cbowireline.$lineno, $cbowireline.$lineno); } // NEXT TWO LINES DOES WORK IN PLACE OF ABOVE THREE LINES //$cbophone->Build(cbowireline1, $cbowireline1); //$cbophone->Build(cbowireline2, $cbowireline2); --------------------------------------------------------------------------- Full Bug description available at: http://bugs.php.net/?id=7824

« previous php.dev (#38122) next »