#42328 [Opn->Bgs]: it's impossible to reference the class using a variable

From: Date: Fri, 17 Aug 2007 13:25:35 +0000
Subject: #42328 [Opn->Bgs]: it's impossible to reference the class using a variable
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-116236@lists.php.net to get a copy of this message
ID: 42328 Updated by: jani@php.net Reported By: taquito at o2 dot pl -Status: Open +Status: Bogus Bug Type: Class/Object related Operating System: mandriva cooker PHP Version: 5.2.4RC2 New Comment: And that comment is already removed from the documentation and documentation is being regenerated right this moment..this feature will be in PHP 5.3.. Previous Comments: ------------------------------------------------------------------------ [2007-08-17 13:24:22] taquito at o2 dot pl Description: ------------ documentation for Scope Resolution Operator (::) states "As of PHP 5.2.4, it's possible to reference the class using a variable", which is not true. example 19.12 is wrong Reproduce code: --------------- <?php class MyClass { const CONST_VALUE = 'A constant value'; } $classname = 'MyClass'; echo $classname::CONST_VALUE; echo MyClass::CONST_VALUE; ?> Expected result: ---------------- A constant valueA constant value Actual result: -------------- Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting ',' or ';' in /home/alhambra/www/tst/test.php on line 8 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42328&edit=1

« previous php.bugs (#116236) next »