Re: php compiler

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

 



Hodicska Gergely wrote:
 > It outputs this: false bool(false) int(0)
Yes, this the right output.
And this output is absolutely correct. Your condition gives new values to $a and $b because you use "=" and not "==". So you do this:
Maybe you never read this:
http://hu2.php.net/manual/en/language.operators.php#language.operators.precedence The result is not so obvious. There sould some internal behavior which cause this.

I don't see the problem. The behaviour of your code matches the precendences in my opinion:

$a = 1 && $b = 0

PHP sees two expressions here:

$a = 1 && $b   (because && has higher priority than =)

and

$b = 0;

So the condition resolves to "1 && 0" while $a is set to false and $b is
set to 0;

So where is the problem?

--
Bye, K <http://www.ailis.de/~k/> (FidoNet: 2:240/2188.18)
[A735 47EC D87B 1F15 C1E9  53D3 AA03 6173 A723 E391]
(Finger k@xxxxxxxx to get public key)

Attachment: signature.asc
Description: OpenPGP digital signature


[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