Re: Why is some_function()[some_index] invalid syntax?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, January 10, 2008 10:00 pm, Arlen Christian Mart Cuss wrote:
> Why is it that if I try to evaluate an index of an array returned by a
> function immediately, a syntax error is produced? (unexpected '[',
> expecting ',' or ';')

Because PHP is not C.

It's language-design was chosen to not let you write complicated
expressions that only confuse beginners.

There was talk of letting this work on php-internals, but it was shot
down, as I recall...

Or perhaps not, but nobody actually submitted a patch to make it work,
so it's one of those "someday" features...

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux