Bug #73494 [Csd->Dup]: Class name As Const
| From: | requinix@php.net | Date: | Fri, 11 Nov 2016 08:41:53 +0000 |
| Subject: | Bug #73494 [Csd->Dup]: Class name As Const | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-205298@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
Updated by: requinix@php.net
Reported by: takeo dot tanha at livce dot com
Summary: Class name As Const
-Status: Closed
+Status: Duplicate
Type: Bug
Package: Class/Object related
PHP Version: 7.0.13
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2016-11-11 08:40:08] takeo dot tanha at livce dot com
go to this : https://bugs.php.net/bug.php?id=73495
------------------------------------------------------------------------
[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