Bug #73494 [Opn->Csd]: Class name As Const
| From: | takeo dot tanha at livce dot com | Date: | Fri, 11 Nov 2016 08:40:10 +0000 |
| Subject: | Bug #73494 [Opn->Csd]: Class name As Const | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-205297@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=73494&edit=1
ID: 73494
User updated by: takeo dot tanha at livce dot com
Reported by: takeo dot tanha at livce dot com
Summary: Class name As Const
-Status: Open
+Status: Closed
Type: Bug
Package: Class/Object related
PHP Version: 7.0.13
Block user comment: N
Private report: N
New Comment:
go to this : https://bugs.php.net/bug.php?id=73495
Previous Comments:
------------------------------------------------------------------------
[2016-11-11 08:36:30] takeo dot tanha at livce dot com
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
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=73494&edit=1