ID: 11063
User Update by: [EMAIL PROTECTED]
Status: Suspended
Bug Type: Feature/Change Request
Operating system: Windows NT 4.0 Build 1381
PHP Version: 4.0.4pl1
Description: $var = function_returning_array(args)[0]; doesn't work

I think that $var=(function_returning_array(args))[0]; should also work, but it does 
not either.

The real problem here is that the [] operator works only on variables, not on general 

Just trying to make php more c-like in it's expression syntax.

Previous Comments:

[2001-05-23 17:33:22] [EMAIL PROTECTED]
This syntax does not make sense at all (to me). It is not present in any language 
A function simply returns an array, and if you want to do something with that, do it 

However, it is a valid feature request, but I don't think it wil be implemented in 
short time.
Changed type to Feature Request and status to Suspended.



[2001-05-23 16:35:48] [EMAIL PROTECTED]
$var = function_returning_array(args)[0];

gives an error but 

$var = function_returning_array(args);

works fine.  I think that either should work.


Full Bug description available at:

PHP Development Mailing List <>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to