#24089 [NEW]: Problem creating objects with names from class' fields

From: Date: Mon, 09 Jun 2003 09:09:37 +0000
Subject: #24089 [NEW]: Problem creating objects with names from class' fields
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-41497@lists.php.net to get a copy of this message
From: bartosz at webcity dot pl Operating system: Linux PHP version: 5CVS-2003-06-09 (dev) PHP Bug Type: *General Issues Bug description: Problem creating objects with names from class' fields Analyse code below, it makes parse error: <?php class foobar2 { function foobar2() { echo phpversion(); } } class foobar { var $classname = 'foobar2'; var $obj; function foobar() { // it works: // // $classname = $this -> classname; // $this -> obj = new $classname; // // but it doesn't work: $this -> obj = new $this -> classname; } } $obj = new foobar; ?> ---------------------------------------- My configure command: './configure' '--with-mysql=/usr' '--with-gd2' '--disable-xml' '--with-apxs=/usr/sbin/apxs' -- Edit bug report at http://bugs.php.net/?id=24089&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=24089&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=24089&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=24089&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=24089&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=24089&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=24089&r=support Expected behavior: http://bugs.php.net/fix.php?id=24089&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=24089&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=24089&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=24089&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24089&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=24089&r=dst IIS Stability: http://bugs.php.net/fix.php?id=24089&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=24089&r=gnused

« previous php.bugs (#41497) next »