Re: [VOTE] ::class feature to resolve namespaced class names to scalars
| From: | Stas Malyshev | Date: | Thu, 13 Sep 2012 20:58:01 +0000 |
| Subject: | Re: [VOTE] ::class feature to resolve namespaced class names to scalars | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-62985@lists.php.net to get a copy of this message | ||
Hi!
>>> I would expect $variable::class to work (like late static bindings).
What this would mean? ClassName::class has a clear meaning - ClassName
is a name of the class (possibly aliased) and class is the property of
this class, namely its full name. However I do not see how
$variable::class can do anything meaningful. Since namespace resolution
is static compile-time, $variable can not be anything but the full name
of the class, so what $variable::class supposed to do? Just be equal to
$variable? What's the point of such operation, what may be achieved by it?
Reference to "late static binding" is even more confusing - if you mean
that $variable is object, then the binding is not "static" - since you
have an object - and you have perfectly good get_class($variable) to do
that. Is that what you were meaning?
--
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227