Re: php compiler

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

 



* 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."

-- 
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