From: [EMAIL PROTECTED] Operating system: Any PHP version: 5CVS-2003-04-02 (dev) PHP Bug Type: Feature/Change Request Bug description: Supported dereferencing array indeces on arbitrary expressions
Supported dereferencing array indeces on arbitrary expressions. Currently you can only dereference array indeces on variables directly: $a = array('a', 'b'); var_dump($a[1]); but this does not work var_dump(array('a', 'b')[1]); neither does this: function returnArray() { return array('a', 'b'); } var_dump(returnArray()[1]); or this: $value = ($ns == 'foo' ? $thisArray : $thatArray)[0]; -- Edit bug report at http://bugs.php.net/?id=23022&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=23022&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=23022&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=23022&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=23022&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=23022&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=23022&r=support Expected behavior: http://bugs.php.net/fix.php?id=23022&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=23022&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=23022&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=23022&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23022&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=23022&r=dst IIS Stability: http://bugs.php.net/fix.php?id=23022&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=23022&r=gnused