Re: Add support $object::class
| From: | Stanislav Malyshev | Date: | Mon, 27 Apr 2015 18:28:08 +0000 |
| Subject: | Re: Add support $object::class | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-85974@lists.php.net to get a copy of this message | ||
Hi!
> 1. get_class($object) - looks bad and long
There's nothing bad in calling functions. Functions are part of PHP and
are completely OK.
> 2. Illogically - Bar::class valid syntax, $object::class invalid
> syntax. 3. Function call get_class($object) is slower
Unless you code is doing get_class literally millions of times, and it's
basically all it does, it does not matter. This kind of "optimization"
does not lead to anything but ugly code and waste of time.
--
Stas Malyshev
smalyshev@gmail.com