ID: 42313 Updated by: [EMAIL PROTECTED] Reported By: phpbugs at colin dot guthr dot ie -Status: Open +Status: Closed Bug Type: Documentation problem Operating System: Linux PHP Version: Irrelevant -Assigned To: +Assigned To: colder New Comment:
This syntax was added in PHP5.2.4RC1 but reverted in PHP5.2.4RC2 and won't be available until PHP5.3.0 (not 5.2.4 as the comment there says). This was fixed in CVS earlier today Previous Comments: ------------------------------------------------------------------------ [2007-08-15 22:48:46] phpbugs at colin dot guthr dot ie Description: ------------ On the following manual page: http://www.php.net/manual/en/language.oop5.paamayim-nekudotayim.php Example 19.13 gives the code listed below. This causes a parse error. Reproduce code: --------------- <?php class OtherClass extends MyClass { public static $my_static = 'static var'; public static function doubleColon() { echo parent::CONST_VALUE . "\n"; echo self::$my_static . "\n"; } } $classname = 'OtherClass'; echo $classname::doubleColon(); OtherClass::doubleColon(); ?> Expected result: ---------------- I would expect $classname::doubleColon() call to succeed according to the docs. The alternative [call_user_func(array($classname, 'doubleColon'))] is not quite as neat in code. Judging by comments on the above linked page this has not worked since 2005! Actual result: -------------- PHP Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting ',' or ';' in file.php on line 13 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42313&edit=1
