php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #41759 Array index from function returned array
Submitted: 2007-06-21 11:50 UTC Modified: 2007-06-21 21:43 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: rudi at mageuk dot com Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 5.2.3 OS: All
Private report: No CVE-ID: None
 [2007-06-21 11:50 UTC] rudi at mageuk dot com
Description:
------------
I don't know the exact name for this. But being able to reference an index from a function that returns an array would be very usefull.

Reproduce code:
---------------
function returnarray() {
   return array('abc' => 'blah blah', '123' => 'blee blee');
}
echo returnarray()['abc'];
echo returnarray()['123'];

Expected result:
----------------
blah blah
blee blee

Actual result:
--------------
Parse Error as it's obviously not implemented...

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-06-21 21:43 UTC] johannes@php.net
This has been discussed multiple times and currently nobody is able to provide a acceptable patch. Please see internals mailing list archives for more information on this.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Dec 10 03:01:25 2019 UTC