ID: 29305 Updated by: [EMAIL PROTECTED] Reported By: php at bucksvsbytes dot com -Status: Open +Status: Bogus Bug Type: Unknown/Other Function Operating System: RHEL 3.1 PHP Version: Irrelevant New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Previous Comments: ------------------------------------------------------------------------ [2004-07-21 16:19:35] php at bucksvsbytes dot com Description: ------------ This bug applies at least through 4.3.2. Sorry about version, but I'm restricted to using rpm's, which means I can never get near the current version. If this disqualifies me from ever reporting bugs, please advise and I will stop. The explode function yields an array result, so you would expect the following statement to be syntactically correct: $result=explode($separator,$string)[$key]; However, that syntax yields a "parse error". The workaround is to assign explode to a variable first: $array=explode($separator,$string); $result=$array[$key]; Reproduce code: --------------- $result=explode(':','a:b:c')[0]; Expected result: ---------------- $result gets 'a' Actual result: -------------- Parse error: parse error ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=29305&edit=1