#23022 [NEW]: Supported dereferencing array indeces on arbitrary expressions
From: mfischer@php.net
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
Thread (17 messages)
- mfischer@php.net
- m_rayman at bigfoot dot com#23022 [Com]: Supported dereferencing array indeces on arbitrary expressions
- kexianbin at diyism dot com#23022 [Com]: Supported dereferencing array indeces on arbitrary expressions
- showmethemoney at google dot com#23022 [Com]: Supported dereferencing array indeces on arbitrary expressions
- jim at akubo dot net#23022 [Com]: Supported dereferencing array indeces on arbitrary expressions
- Anatorian at gmail dot com#23022 [Com]: Supported dereferencing array indeces on arbitrary expressions
- kexianbin at diyism dot com#23022 [Com]: Supported dereferencing array indeces on arbitrary expressions
- kexianbin at diyism dot com#23022 [Com]: Supported dereferencing array indeces on arbitrary expressions
- glennwidener at gmail dot com#23022 [Com]: Supported dereferencing array indeces on arbitrary expressions
- kexianbin at diyism dot com#23022 [Com]: Supported dereferencing array indeces on arbitrary expressions
- billyellison99 at gmail dot com#23022 [Com]: Supported dereferencing array indeces on arbitrary expressions
- zeb at zebhodge dot com#23022 [Com]: Supported dereferencing array indeces on arbitrary expressions
- aharvey@php.net#23022 [Opn->Bgs]: Supported dereferencing array indeces on arbitrary expressions
- cataphract@php.netReq #23022 [Bgs->Csd]: Supported dereferencing array indeces on arbitrary expressions
- cataphract@php.netReq #23022 [Csd]: Supported dereferencing array indeces on arbitrary expressions
- hovik dot melikyan at gmail dot comReq #23022 [Com]: Supported dereferencing array indeces on arbitrary expressions
- felipe@php.netReq #23022 [Csd]: Supported dereferencing array indeces on arbitrary expressions