ID:               43138
 Updated by:       [EMAIL PROTECTED]
 Reported By:      felipensp at gmail dot com
-Status:           Open
+Status:           Wont fix
 Bug Type:         Feature/Change Request
 Operating System: Linux
 PHP Version:      5.3
 Assigned To:      colder
 New Comment:

After some discussions, keywords won't be allowed in dynamic class
references. It will be documented accordingly.


Previous Comments:
------------------------------------------------------------------------

[2007-10-30 20:07:13] [EMAIL PROTECTED]

This behavior is consistent with the old one: new $classname is also
available in version prior to 5.3, and works the same way.

self and parent are keywords, not real class names. Hence I reclassify
this report as a feature request.

------------------------------------------------------------------------

[2007-10-30 11:36:02] felipensp at gmail dot com

Description:
------------
'self' and 'parent' don't are evaluated when calling static
member/method with class name in variables.

Reproduce code:
---------------
<?php

class foo {
  const foo = 1;
  public function __construct() {    
    $classname = 'parent';
    echo $classname::FOO;
    // Fatal error: Class 'parent' not found
    
    $classname = 'self';
    echo $classname::FOO;
    // Fatal error: Class 'self' not found 
    
    // new $classname; too
  }
}

new foo;

Actual result:
--------------
Fatal error: Class 'parent' not found

and

Fatal error: Class 'self' not found 


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=43138&edit=1

Reply via email to