# Deferencing index of an array returned from function call

- Thread: https://externals.io/message/8911
- Original archive: https://news-web.php.net/php.internals/8911
- Started by Andrey Hristov on 2004-04-03T16:58:52+00:00
- Messages: 2
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #8911 — Andrey Hristov — 2004-04-03T16:58:52+00:00

URL: https://externals.io/message/8911#8911

Hi internals,
maybe I am late for this for PHP 5 but just want to ask for opinion about dereferencing 
indexes of arrays returned by functions. In PHP 5 is possible to dereference member 
variables of an objects like :
someFunc()->someMember;
but this :
$b = someFunction()['someIndex'];
is not possible


Andrey

---

## #8913 — Andi Gutmans — 2004-04-03T17:08:53+00:00

URL: https://externals.io/message/8911#8913 · In reply to: #8911

At 06:58 PM 4/3/2004 +0200, Andrey Hristov wrote:
>Hi internals,
>maybe I am late for this for PHP 5 but just want to ask for opinion about 
>dereferencing indexes of arrays returned by functions. In PHP 5 is 
>possible to dereference member variables of an objects like :
>someFunc()->someMember;
>but this :
>$b = someFunction()['someIndex'];
>is not possible

This is a well known feature request but won't be supported in PHP 5.0.
I can't tell you if it'll ever be supported. It requires some research and 
a lot of thought.

Andi
