ID: 36221
Updated by: [EMAIL PROTECTED]
Reported By: david at tulloh dot id dot au
-Status: Open
+Status: Closed
Bug Type: Feature/Change Request
-Operating System: Debian Linux
+Operating System: *
-PHP Version: 5.1.2
+PHP Version: 5.*
-Assigned To:
+Assigned To: helly
New Comment:
Use 'self' instead:
php -r 'class t{static function f(){ var_dump(new self);}} t::f();'
Previous Comments:
------------------------------------------------------------------------
[2006-01-31 08:18:17] david at tulloh dot id dot au
Description:
------------
It would be nice if, $object = new __CLASS__(); was supported.
Currently this throws a parse/syntax error,
Parse error: syntax error, unexpected T_CLASS_C, expecting T_STRING or
T_VARIABLE or '$' in ...
This does work as expected,
$foo = __CLASS__;
$object = new $foo();
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36221&edit=1