|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-12-03 15:59 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 02:00:01 2025 UTC |
Description: ------------ In using inline functions that return arrays, please make php capable of using values stored at particular indexes. For example, $class->function_call()[index] or ($class->function_call())[index]. Basically, the same use as other langauges. Thank you for your time. Sincerely, Scott B Britton Reproduce code: --------------- class test { private $scott = array("Scott", "B", "Britton"); public function return_scott() { return $this->scott; } } $s = new test(); printf("%s", $s->return_scott()[0]); Expected result: ---------------- I expected to see "Scott" printed to the screen Actual result: -------------- Syntax error, unexpected '['