From: sskaje at gmail dot com
Operating system: Windows XP Professional sp2
PHP version: 5.2.5
PHP Bug Type: Class/Object related
Bug description: static method ?
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 bug report at http://bugs.php.net/?id=44451&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=44451&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=44451&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=44451&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=44451&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=44451&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=44451&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=44451&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=44451&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=44451&r=support
Expected behavior: http://bugs.php.net/fix.php?id=44451&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=44451&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=44451&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=44451&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44451&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=44451&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=44451&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=44451&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=44451&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=44451&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=44451&r=mysqlcfg