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

From: Date: Tue, 17 Apr 2012 19:31:29 +0000
Subject: Re: Re: New Feature: Fully qualified class name resolution as scalar with class keyword
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message

How would static::class behave ? is it handled by the current patch? Maybe the test case could be extended to reflect this, and also for self::class?
Fantastic question. I am unsure how to handle this. Currently, it will simply resolve those names against the rules (I am sure this is the wrong behavior.) So, namespace Foo\Bar { var_dump(self::class); } Would now produce: string(12) "Foo\Bar\self" This is the same with 'self', 'static', and 'parent'. I guess the question is, should that produce a compile error, or conditionally work depending on if you are inside of a class declaration or not? I will add this consideration to the RFC. -ralph

Thread (41 messages)

« previous php.internals (#60101) next »