Edit report at https://bugs.php.net/bug.php?id=64871&edit=1

 ID:                 64871
 Updated by:         vr...@php.net
 Reported by:        vr...@php.net
 Summary:            The ::class operator should verify the class name
 Status:             Open
 Type:               Feature/Change Request
 Package:            Class/Object related
 Operating System:   Any
 PHP Version:        5.5.0RC1
-Assigned To:        
+Assigned To:        ralphschindler
 Block user comment: N
 Private report:     N

 New Comment:

Ralph, what's your take on this?


Previous Comments:
------------------------------------------------------------------------
[2013-05-17 16:48:42] vr...@php.net

Description:
------------
One of the main advantages of the ::class operator could be that it verifies 
the class name upon creating the string instead of upon usage. It should 
trigger autoloading if the class doesn't exist.

I know that it's somewhat late to change this in PHP 5.5 but I was really 
surprised by the lack of this feature and about the fact that it wasn't 
considered in RFC.


Test script:
---------------
<?php
// I want to know about this typo.
echo stdClas::class;


Expected result:
----------------
Fatal error: Class 'stdClas' not found

Actual result:
--------------
stdClas


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=64871&edit=1

Reply via email to