#21820 [Ver]: bc break in parser

From: Date: Thu, 23 Jan 2003 02:28:57 +0000
Subject: #21820 [Ver]: bc break in parser
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-31000@lists.php.net to get a copy of this message
ID: 21820 User updated by: george@omniti.com Reported By: george@omniti.com Status: Verified Bug Type: Scripting Engine problem PHP Version: 4.3.0 New Comment: This bug appeared in 4.3.0 as a result of the lexer changes added to ZE1 and ZE2 in november to speed up variableinterpolation in strings. Previous to 4.3 this was valid: echo "$a[b]"; but echo "$a['b']"; generated a parse error. The bug manifests itself by turning this parse error into a non-sensical E_NOTICE error. The patch 'fixes' the bug by making echo "$a['b']"; work, which has been a pending feature request and seems nice (to me), or at least harmless. Previous Comments: ------------------------------------------------------------------------ [2003-01-22 19:53:20] sniper@php.net Anyone remember in what version of PHP this did work? :) Correct (?) way to do this is: <?php $arr = array('foo' => 'bar'); print "{$arr['foo']}"; ?> Or at least I've started to use that just because of this bug. ------------------------------------------------------------------------ [2003-01-22 13:56:01] philip@php.net Point was, maybe there is a reason this was not implemented. And btw, this is a bug as 'foo' is defined yet the error says it's not. ------------------------------------------------------------------------ [2003-01-22 13:45:54] george@omniti.com this patch fixes that feature request/bug as well ------------------------------------------------------------------------ [2003-01-22 13:43:05] philip@php.net Allowing it would be nice but this topic has come up many times. Not sure why it's not been implemented though, maybe there are reasons? I forget them. One feature request for this: http://bugs.php.net/bug.php?id=15677 ------------------------------------------------------------------------ [2003-01-22 13:25:11] george@omniti.com patch up at http://www2.omniti.com/~george/ zend.patch.2002012101 patch allows for "$arr['foo']" to be parsed correctly (this seems better than disallowing it) ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/21820 -- Edit this bug report at http://bugs.php.net/?id=21820&edit=1

« previous php.bugs (#31000) next »