Re: Regarding constructions like func()[0]
| From: | Mathieu Suen | Date: | Tue, 10 Nov 2009 09:44:48 +0000 |
| Subject: | Re: Regarding constructions like func()[0] | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-45987@lists.php.net to get a copy of this message | ||
jvlad a écrit :
"Mathieu Suen" <mathieu.suen@easyflirt.com> wrote in message news:4AF91F92.4000101@easyflirt.com...From the grammar point of view it should not generate that mush conflict. Unless the grammar is not well written. Looking at the zend_language_parser.y it's awfully complicate. Of course the compiler/parser should change -mthkWhy isn't a mater of pushing the function call statement into a valuable statement? I guess something like this: statement : | value | function_call; value : | valriable | array_access | method_send | ...;...You also could push the new statement into the value so you can do: (new A())->foo(); or foo(new A()); -mthkHow many conflicts does it bring? For example patch offered in this issue http://bugs.php.net/bug.php?id=50003 brought 5 new conflicts. Please note that in some cases conflicts will delay calls to zend_compile.c functions and therefore may bring real problems. IMHO it's not as simple as populating grammar elements. The results must be carefully tested to avoid BC breakage. just 2c