|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-01-17 18:05 UTC] paramount_98 at hotmail dot com
[2008-01-17 18:15 UTC] felipe@php.net
[2008-01-17 18:18 UTC] bjori@php.net
[2008-01-17 19:06 UTC] colder@php.net
[2020-02-07 06:10 UTC] phpdocbot@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 07 11:00:02 2026 UTC |
Description: ------------ Run example #1 on PHP 5.2.5 produces parse error. Reproduce code: --------------- <?php class MyClass { const constant = 'constant value'; function showConstant() { echo self::constant . "\n"; } } echo MyClass::constant . "\n"; $classname = "MyClass"; echo $classname::constant . "\n"; $class = new MyClass(); $class->showConstant(); echo $class::constant."\n"; ?> Expected result: ---------------- outputs 'constant value' Actual result: -------------- Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM, expecting ',' or ';' in /www/mydomain.com/httpdocs/class-constant-test.php on line 14