Bug #67547 [NEW]: New feature working for undeclared classes
| From: | magnusthorek at gmail dot com | Date: | Mon, 30 Jun 2014 16:21:39 +0000 |
| Subject: | Bug #67547 [NEW]: New feature working for undeclared classes | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-186395@lists.php.net to get a copy of this message | ||
From: magnusthorek at gmail dot com
Operating system: N/A
PHP version: 5.5.14
Package: Class/Object related
Bug Type: Bug
Bug description:New feature working for undeclared classes
Description:
------------
PHP 5.5 has implemented as a new feature a new way to retrieve the
classname through the syntax ::class:
It work ver well as described in "Sample #1" below. But why this syntax
also returns a classname when used alongside an undeclared class,
according to "Sample #2"?
In several other cases an error is raised, but not here. Anyone know,
with concrete basis if possible, why does this happen?
Does it have anything to Late Static Bindings or it's just a (temporary)
limitation/bug of this brand new feature?
Test script:
---------------
<?php
// Sample #1
namespace Testing;
class Test{}
echo Test::class; // Testing\Test;
?>
<?php
// Sample #2
echo UndeclaredClass::class; // UndeclaredClass
Expected result:
----------------
For "Sample #1":
Testing\test;
For Sample #2:
Fatal error: Class 'UndeclaredClass'...
Actual result:
--------------
For "Sample #1":
Testing\test;
For Sample #2:
UndeclaredClass
--
Edit bug report at https://bugs.php.net/bug.php?id=67547&edit=1
--