#42100 [Opn]: strings & arrays

From: Date: Wed, 25 Jul 2007 11:13:49 +0000
Subject: #42100 [Opn]: strings & arrays
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-115418@lists.php.net to get a copy of this message
 ID:               42100
 User updated by:  lunter at interia dot pl
 Reported By:      lunter at interia dot pl
 Status:           Open
 Bug Type:         Feature/Change Request
 Operating System: WinXP
 PHP Version:      6CVS-2007-07-25 (CVS)
 New Comment:

For example:

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

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


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

[2007-07-25 10:51:48] lunter at interia dot pl

Description:
------------
Direct reference to arrays and strings, etc (like in JS, C#).

Reproduce code:
---------------
<?
 print( array('a','b','c')[0] );
 print( 'abc'[1] );
?>

Expected result:
----------------
printed: ab

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


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


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


Thread (4 messages)

« previous php.bugs (#115418) next »