|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-03-17 02:18 UTC] sskaje at gmail dot com
[2008-03-17 05:27 UTC] nulubo200 at yahoo dot com
[2008-03-17 10:56 UTC] felipe@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 17:00:01 2025 UTC |
Description: ------------ Read the example shown on php manual, from the 'Static Keyword' part of '19. Classes and Objects (PHP 5)'. there's an example at the bottom of that page which: Example 19.16. Static method example [code] <?php class Foo { public static function aStaticMethod() { // ... } } Foo::aStaticMethod(); $classname = 'Foo'; $classname::aStaticMethod(); ?> [/code] i tried it, but there is a parse error reported: Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in H:\server\wwwroot\test\static.php on line 10 then i tried the Example 19.15. Static member example but i got a same error i wanna know if its' a bug or just a coming up feature ? Reproduce code: --------------- <?php class Foo { public static function aStaticMethod() { echo 'haha, static method'; } } Foo::aStaticMethod(); $classname = 'Foo'; $classname::aStaticMethod(); ?> Expected result: ---------------- haha, static method Actual result: -------------- Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in H:\server\wwwroot\test\static.php on line 10