|  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
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
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...


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-06-21 21:43 UTC]
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-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 24 16:01:28 2024 UTC