Re: [VOTE] ::class feature to resolve namespaced class names to scalars
| From: | Simon J Welsh | Date: | Thu, 13 Sep 2012 08:34:22 +0000 |
| Subject: | Re: [VOTE] ::class feature to resolve namespaced class names to scalars | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-62967@lists.php.net to get a copy of this message | ||
On 13/09/2012, at 8:28 PM, Lars Strojny <lars@strojny.net> wrote:
> Hi Dmitry,
>
> Am 13.09.2012 um 10:17 schrieb Dmitry Stogov <dmitry@zend.com>:
> [...]
>> I think the syntax is wired.
>> Instead of classname::class I would prefer something like class(classname).
>
> Wouldn’t this look too much like a function with all the implications that might cause like
> users expecting class($variable) to work or even class(otherfunc())?
>
> cu,
> Lars
I would expect $variable::class to work (like late static bindings). However, I do agree that
class(ClassName) just looks off and makes it look like you can pass class names to functions.
---
Simon Welsh
Admin of http://simon.geek.nz/