| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
  [2006-01-31 08:18 UTC] 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(); PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             | 
    |||||||||||||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 06:00:01 2025 UTC | 
Use 'self' instead: php -r 'class t{static function f(){ var_dump(new self);}} t::f();'