Re: [VOTE] ::class feature to resolve namespaced class names to scalars

From: Date: Thu, 13 Sep 2012 21:39:36 +0000
Subject: Re: [VOTE] ::class feature to resolve namespaced class names to scalars
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-62990@lists.php.net to get a copy of this message
Hi! > 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... I guess it can be made work if we do it right - e.g. via ZEND_FETCH_CONSTANT. I'm not a big fan of inventing new syntax for things that already exist and can be done with the same effort - but technically it should be possible. -- Stanislav Malyshev, Software Architect SugarCRM: http://www.sugarcrm.com/ (408)454-6900 ext. 227

« previous php.internals (#62990) next »