|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-05-03 12:15 UTC] johannes@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 17 08:00:01 2025 UTC |
Description: ------------ When you get a reference to an array, by a function, there is no way to access any certain member of the array. With this function given: <?php function get_array() { return array("foo" => "FOO", "bar" => "BAR"); } ?> there is no way to do: <?php print get_array()["foo"] ?> You have to do like this: <?php $array = get_array(); print $array["foo"]; ?> There should be a way to access a member of the array in only one expression, without the need for assigning a variable. Either by using the first syntax above, or if you don't like the looks of it, maybe a function like this: <?php print array_value(get_array(), "foo") ?>