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

From: Date: Fri, 11 Jan 2008 04:10:43 +0000
Subject: Re: Why is some_function()[some_index] invalid syntax?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-267063@lists.php.net to get a copy of this message
On Jan 10, 2008, at 8:00 PM, Arlen Christian Mart Cuss <celtic@sairyx.org
wrote:
Hi there, 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 ';') Thanks, Arlen.
I've run into this problem. (It works in Javascript >.>) While I don't know why, you could store it in a temporary variable or use the list() language construct. -Casey

« previous php.general (#267063) next »