#44451 [Opn->Bgs]: static method ?

From: Date: Mon, 17 Mar 2008 10:56:25 +0000
Subject: #44451 [Opn->Bgs]: static method ?
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-606@lists.php.net to get a copy of this message
ID: 44451 Updated by: felipe@php.net Reported By: sskaje at gmail dot com -Status: Open +Status: Bogus -Bug Type: Class/Object related +Bug Type: Documentation problem Operating System: Windows XP Professional sp2 PHP Version: 5.2.5 New Comment: Exactly, as of 5.3.0. Thanks. Previous Comments: ------------------------------------------------------------------------ [2008-03-17 05:27:59] nulubo200 at yahoo dot com The example you are referring to is located at: http://docs.php.net/manual/en/language.oop5.static.php There is a comment in the example that says it is available in php 5.3.0. So to answer your question...it is a feature to look forward to. I think this bug can be closed. ------------------------------------------------------------------------ [2008-03-17 02:18:37] sskaje at gmail dot com Expected result should be: ---------------- haha, static methodhaha, static method ------------------------------------------------------------------------ [2008-03-17 02:16:22] sskaje at gmail dot com 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 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=44451&edit=1

« previous php.doc.bugs (#606) next »