|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-06-30 17:01 UTC] requinix@php.net
-Status: Open
+Status: Not a bug
[2014-06-30 17:01 UTC] requinix@php.net
[2014-06-30 17:25 UTC] magnusthorek at gmail dot com
[2014-06-30 17:59 UTC] requinix@php.net
[2014-06-30 18:51 UTC] magnusthorek at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 07 01:00:01 2025 UTC |
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