Re: Null bytes in anonymous class names
| From: | Rowan Collins | Date: | Wed, 11 Nov 2015 10:57:49 +0000 |
| Subject: | Re: Null bytes in anonymous class names | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-89174@lists.php.net to get a copy of this message | ||
Steven Hilder wrote on 11/11/2015 02:13:
This behaviour was present in Joe's original implementation, but later removed[3] by Nikita. His commit message says that this was "dead code", but I don't see what was wrong with it.It looks to me like 'decl->name' will never be set for an anonymous class, so the old code was just passing a null into zend_name_anon_class(), which is pointless (hence "dead" code, i.e. "unreachable"). I guess what it should have been passed (maybe was in previous revisions) was extends_name, which is only extracted from the AST much further down the function. http://git.php.net/?p=php-src.git;a=blob;f=Zend/zend_compile.c;hb=HEAD#l5315