::class wrong case
| From: | Marc Bennewitz | Date: | Mon, 25 May 2015 17:47:32 +0000 |
| Subject: | ::class wrong case | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-86380@lists.php.net to get a copy of this message | ||
Hi,
I have noted that detecting a class name using "::class" it will return the called case instead of the original case.
see http://3v4l.org/97K36
That's annoying as I like to check the right class case on autoload to detect mistakes.
Sure, class names in PHP are case-insensitive but filesystems aren't and most autoloader using the FS to find the right file. To catch such kind of mistakes I would like to implement a fast check in my autoloader to get noted on development instead on production. It's currently only possible with ReflectionClass but this will be much slower as with ::class.
Are there any reasons to get the called case of the class instead or the original one?
Marc