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

From: Date: Tue, 17 Apr 2012 19:52:01 +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


Would changing the definition for class_name_scalar be sufficient?
     class_name_scalar:
         class_name { zend_resolve_class_name(&$1, ZEND_FETCH_CLASS_GLOBAL,
1 TSRMLS_CC); $$ = $1; }
     ;
To my eye, this is the least surprising syntax.
As far as I can tell, this rule will not compile as it conflicts with other rules, namely around the namespace implementation rules. Besides that though, an original design goal was to implement it closer to how other languages solve the same-ish problem. This solution is somewhat in line with Java (.class) and Ruby (.class.name), Python actually uses the same but instead of .class, they use .__class__.__name__ -ralph

Thread (41 messages)

« previous php.internals (#60106) next »