Re: Scalar Type Declaration Syntax Weirdness

From: Date: Wed, 25 Nov 2015 19:58:20 +0000
Subject: Re: Scalar Type Declaration Syntax Weirdness
References: 1 2 3 4 5 6 7 8 9 10 11  Groups: php.internals 
Request: Send a blank email to internals+get-89431@lists.php.net to get a copy of this message
Hi, Xinchen Hui wrote:
Hey: On Wed, Nov 25, 2015 at 5:57 PM, Nikita Popov <nikita.ppv@gmail.com> wrote:
Imho this additional change is not necessary, it only makes the parser more complicated. However something missing from the original patch is handling of relative names like namespace\int. Instead of checking for ast->attr == ZEND_NAME_FQ it should check for ast->attr != ZEND_NAME_NOT_FQ.
PS: However, namespace\int will result error while checking valid classname, as int is reserved keywords. so I think check for == ZEND_NAME_FQ is enough here.
This is how I feel as well. You can't make a class with that name anyway (at least for now), so we don't need to prohibit it. \int was a problem because it was interpreted the same as 'int'. Thanks. -- Andrea Faulds http://ajf.me/

« previous php.internals (#89431) next »