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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: rudi at mageuk dot com
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 19:01:29 2024 UTC