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

Add a Patch

Pull Requests

Add a Pull Request

History

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