|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-02-22 09:42 UTC] hartmut at six dot de
<?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 ...
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 19:00:02 2025 UTC |
Over 7 years and we still have survived with {} around these. Plus they make stuff more readable.