|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-07-14 10:48 UTC] johannes@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 18 21:00:01 2025 UTC |
Description: ------------ It seems very strange that the [] operator cannot be used on the result of a function. Reproduce code: --------------- function test() { return array('dog','cat'); } echo test()[0]; // produces a syntax error. of course this works fine class temp{} function test() { $o = new $temp; $temp->foo = 'dog'; } echo test()->foo; // works Expected result: ---------------- dog