#43577 [Opn->WFx]: operator []

From: Date: Wed, 12 Dec 2007 09:31:30 +0000
Subject: #43577 [Opn->WFx]: operator []
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-120593@lists.php.net to get a copy of this message
 ID:               43577
 Updated by:       derick@php.net
 Reported By:      lunter at interia dot pl
-Status:           Open
+Status:           Wont fix
 Bug Type:         Feature/Change Request
 Operating System: all
 PHP Version:      6CVS-2007-12-12 (CVS)
 New Comment:

We discussed this already as well a few times, also not going to
happen.


Previous Comments:
------------------------------------------------------------------------

[2007-12-12 09:04:10] 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 '['



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=43577&edit=1


Thread (3 messages)

« previous php.bugs (#120593) next »