Posted by Ewoud Dronkert on 05/21/05 11:13
On Sat, 21 May 2005 09:24:55 +0200, Marcin wrote:
> Why does the following script output 3? Can anyone explain that?
> echo true? 2: false? 3: 4 ;
It is evaluated from left to right like so
echo ((true ? 2 : false) ? 3 : 4);
echo (2 ? 3 : 4);
echo 3;
--
Firefox Web Browser - Rediscover the web - http://getffox.com/
Thunderbird E-mail and Newsgroups - http://gettbird.com/
[Back to original message]
|