Bug #76853 [NEW]: ::class blindly returns whatever string precedes it, even if clas doesn't exist
| From: | teo8976 at gmail dot com | Date: | Sun, 09 Sep 2018 16:15:18 +0000 |
| Subject: | Bug #76853 [NEW]: ::class blindly returns whatever string precedes it, even if clas doesn't exist | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-216947@lists.php.net to get a copy of this message | ||
From: teo8976 at gmail dot com
Operating system: all
PHP version: 7.3.0beta3
Package: *General Issues
Bug Type: Bug
Bug description:::class blindly returns whatever string precedes it, even if clas doesn't exist
Description:
------------
see below
Test script:
---------------
<?php
echo \skljnsdkf\olsjdnvsjd::class;
Expected result:
----------------
Fatal error: Uncaught Error: Class 'skljnsdkf\olsjdnvsjd' not found
Actual result:
--------------
outputs this:
\skljnsdkf\olsjdnvsjd
as if the class existed.
Not only is this wrong, it is not even documented.
The documentation about "::class" is pathetic. It's not easy to find in
the first place; all I could find is here:
http://be2.php.net/manual/en/language.oop5.constants.php
"""
The special ::class constant are [sic] available as of PHP 5.5.0, and
allows for fully qualified class name resolution at compile [time??],
this is useful for namespaced classes:
"""
--
Edit bug report at https://bugs.php.net/bug.php?id=76853&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76853&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76853&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76853&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=76853&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=76853&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=76853&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=76853&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=76853&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=76853&r=support
Expected behavior: https://bugs.php.net/fix.php?id=76853&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=76853&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=76853&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=76853&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76853&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=76853&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=76853&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=76853&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=76853&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=76853&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=76853&r=mysqlcfg