Re: New Feature: Fully qualified class name resolution as scalar with class keyword

From: Date: Mon, 16 Apr 2012 06:18:21 +0000
Subject: Re: New Feature: Fully qualified class name resolution as scalar with class keyword
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
2012/4/16 Ralph Schindler <[email protected]>
>
> I am not quite following.  There is no functional difference between
> "class", "CLASS", or "Class".  The parser is case insensitive
> with regards
> to keywords, which "class" or T_CLASS is on of.  The code snipped I showed
> there was from the .phpt test that I had included in the Zend/test code base
> to ensure it worked and did not break existing tests.
>
> As per the namespaced and non-namespaced blocks, I was demonstrating how
> ::class would resolve names regardless of if it were a FQCN or a short class
> name.  Effectively, you can put ::class behind any "type" name and it should
> work as demonstrated.
>
> -ralph
>

Hi, Ralph

Thanks for clarification.
I was missing the backslash before Moo::Class which lead to that thought.

As the class-definition for Moo is missing, I think it's an empty
class (like Baz) on the root-level defined somewhere else, right?
Otherwise this should do something else than guessing the class-name.

Bye
Simon


Thread (41 messages)

« previous php.internals (#59984) next »