Bug #703: Parser Error occurs when on obj with constructor created with eval

From: Date: Sun, 30 Aug 1998 00:54:49 +0000
Subject: Bug #703: Parser Error occurs when on obj with constructor created with eval
Groups: php.dev 
Request: Send a blank email to php-dev+get-655@lists.php.net to get a copy of this message
From: sheffield_e@mediasoft.net Operating system: Linux 2.0.33 PHP version: 3.0.3 PHP Bug Type: Parser error Bug description: This bug was discovered using the PHP Base Library with PHP 3.0.3. Part of this library essentially performs a call like: eval('$GLOBALS["auth"]=new Album_Auth;'); The problem is that if Album_Auth has a constructor, then a Parse Error occurs on the line containing the closing '}' at the end of the class definition. If there is no constructor, everything is fine. A workaround I found was to modify the code so that the call became: eval('$GLOBALS["auth"]=$this->makeobject("Album_Auth");'); and I defined a the makeobject function as: function makeobject($obj) { return new $obj; } This seems to work fine. -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#655) next »