Re: php compiler
| From: | Curt Zirzow | Date: | Sat, 30 Oct 2004 20:10:26 +0000 |
| Subject: | Re: php compiler | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-200731@lists.php.net to get a copy of this message | ||
* Thus wrote Hodicska Gergely:
> If you see the output, it seems, that PHP evaluate first $b = 0, and
> this is the problem.
>
> > $a = 1 && $b = 0
> > PHP sees two expressions here:
>
> After the precedence table the first thing should be evaluating 1 && $b,
> so we get:
> $a = false = 0
> Which is not meaningful thing, and maybe this cause that the evaluating
> of the statment is not in the right order.
&& takes precedence to the left operator's expression and compares
it to the right side, you really want;
$a = 1 && $b && $b = 0
In what ever case, your expression is rather unclear on what you
want to happen.
if( 1 && $b ) {
$a = 1;
$b = 0;
)
Curt
--
Quoth the Raven, "Nevermore."