Re: note 12006 added to language.operators.comparison.php
| From: | Jesus M. Castagnetto | Date: | Sun, 18 Mar 2001 00:39:01 +0000 |
| Subject: | Re: note 12006 added to language.operators.comparison.php | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-12514@lists.php.net to get a copy of this message | ||
Have you submitted this as a bug report? If not,
please do, otherwise the php-dev team will not see it.
--- dima@dont.spam.me.at.cc.hut.fi wrote:
> apparantely trinary operator "?:" doesn't always
> work as expected if conditions are chained, e.g.
> instead of
> $a = (ereg("a",$b))? "aaa":
> (ereg("b",$b))? "bbb":
> (ereg("c",$b))? "ccc":
> "other";
> you need to type:
> $a = (ereg("a",$b))? "aaa":
> ((ereg("b",$b))? "bbb":
> ((ereg("c".$b))? "ccc":
> "other"));
> to achieve desired effect.
> (that is use parenteses to help the parser out)
>
> I suspect it's a bug, because the 1st way used to
> work for a while and then stoppped, 2nd works
> always.
>
> Server version: Apache/1.3.9 (Unix) Debian/GNU
>
>
>
http://www.php.net/manual/en/language.operators.comparison.php
>
>
>
> --
> PHP Notes Mailing List (http://www.php.net/)
> To unsubscribe, e-mail:
> php-notes-unsubscribe@lists.php.net
> For additional commands, e-mail:
> php-notes-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>
=====
--- Jesus M. Castagnetto <jmcastagnetto@php.net>
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/