Stas,

On Thu, Sep 13, 2012 at 4:58 PM, Stas Malyshev <smalys...@sugarcrm.com>wrote:

> 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?
>

Right now, you can access static properties and methods from a
string/object by doing $var::$foo... I would assume that this works the
same way. That way, you can take in a string class name, or an object, and
get the class in one shot `$obj::class` instead of `get_class($obj)`...
Just for consistency...

Anthony

Reply via email to