php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #32153 New way of accessing array values
Submitted: 2005-03-01 18:29 UTC Modified: 2007-08-20 10:48 UTC
Votes:5
Avg. Score:3.0 ± 1.7
Reproduced:3 of 5 (60.0%)
Same Version:1 (33.3%)
Same OS:1 (33.3%)
From: switch at andrewwade dot co dot uk Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 5.x OS: Any
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: switch at andrewwade dot co dot uk
New email:
PHP Version: OS:

 

 [2005-03-01 18:29 UTC] switch at andrewwade dot co dot uk
Description:
------------
It would be good if we could access array data in the example shown below.

function myFunction() {
return array('foo' => 'bar');
}

$value = myFunction()['foo'];

Instead of:

function myFunction() {
return array('foo' => 'bar');
}
$return = myFunction();
$value = $return['foo'];


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-20 10:48 UTC] scottmac@php.net
Duplicate of bug #23022
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 09 23:01:33 2025 UTC