From:             [EMAIL PROTECTED]
Operating system: *
PHP version:      4.1.1
PHP Bug Type:     Feature/Change Request
Bug description:  quoted array index in string should be possible

<?php echo "$array[index]"; ?>

works while

<?php echo "$array['index']"; ?>

gives

PHP Parse error:  parse error, expecting `T_STRING' or `T_VARIABLE' or
`T_NUM_STRING' in - on line 1

the error message is not very helpfull (knowing the exact character
position in the line would help a little bit, but that's another story)
and the different syntax requirements for array indices within and outside
of strings are somtimes confusing for newbies, too

so "$array['index']" should be supported by the parser

PS: i know about "{$array['index']}", but that is not the point ...
-- 
Edit bug report at http://bugs.php.net/?id=15677&edit=1
-- 
Fixed in CVS:        http://bugs.php.net/fix.php?id=15677&r=fixedcvs
Fixed in release:    http://bugs.php.net/fix.php?id=15677&r=alreadyfixed
Need backtrace:      http://bugs.php.net/fix.php?id=15677&r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=15677&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=15677&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=15677&r=notwrong
Not enough info:     http://bugs.php.net/fix.php?id=15677&r=notenoughinfo
Submitted twice:     http://bugs.php.net/fix.php?id=15677&r=submittedtwice

Reply via email to