|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-11-11 08:40 UTC] takeo dot tanha at livce dot com
-Status: Open
+Status: Closed
[2016-11-11 08:40 UTC] takeo dot tanha at livce dot com
[2016-11-11 08:41 UTC] requinix@php.net
-Status: Closed
+Status: Duplicate
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 19:00:01 2025 UTC |
Description: ------------ in example we have a class (bar) that have a static function that do somthing. when in other class (foo) we Define bar class name as Const and when we want use it to run static function we have an error : Parse error: syntax error, unexpected '::' (T_PAAMAYIM_NEKUDOTAYIM) in index.php on line 7 Test script: --------------- class foo { const MY_CONST = "bar"; public function __construct() { self::MY_CONST::message(); } } class bar { public static function message() { echo "hello"; } } new foo(); Expected result: ---------------- Parse error: syntax error, unexpected '::' (T_PAAMAYIM_NEKUDOTAYIM) in index.php on line 7