php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #43577 operator []
Submitted: 2007-12-12 09:04 UTC Modified: 2007-12-12 09:31 UTC
Votes:4
Avg. Score:4.8 ± 0.4
Reproduced:3 of 3 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: lunter at interia dot pl Assigned:
Status: Wont fix Package: Feature/Change Request
PHP Version: 6CVS-2007-12-12 (CVS) OS: all
Private report: No CVE-ID:
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-12-12 09:04 UTC] lunter at interia dot pl
Description:
------------
I would be nice if PHP 6.x can use operator [] with called function.


Reproduce code:
---------------
<?
 function f(){
  return(array('a','b'));
 }

 print(f()[0]);
?>


Expected result:
----------------
Like now:

<?
 function f(){
  return(array('a','b'));
 }

 $f=f();
 print($f[0]);
 unset($f);
?>

Actual result:
--------------
Parse error: syntax error, unexpected '['


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-12-12 09:31 UTC] derick@php.net
We discussed this already as well a few times, also not going to happen.
 [2011-01-02 10:49 UTC] semtlenori at gmail dot com
to derick@php.net

Can you tell me where I can read the discussion? I am very interested in this 
issue, but can't find any discussions.

Thanks in advance.
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Mon Apr 21 04:01:57 2014 UTC