Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:13634 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21987 invoked by uid 1010); 30 Oct 2004 18:45:00 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 21960 invoked from network); 30 Oct 2004 18:44:59 -0000 Received: from unknown (HELO amitabha.axelero.hu) (195.228.240.92) by pb1.pair.com with SMTP; 30 Oct 2004 18:44:59 -0000 Received: from amitabha (localhost-02 [127.0.2.1]) by amitabha.axelero.hu (8.12.11/8.12.11) with SMTP id i9UIixVw060410 for ; Sat, 30 Oct 2004 20:44:59 +0200 (CEST) Received: from fe04.axelero.hu [127.0.2.1] via SMTP gateway by amitabha [195.228.240.92]; id A0EBF50139D at Sat, 30 Oct 2004 20:44:59 +0200 Received: from [192.168.1.100] (9.50-182-adsl-pool.axelero.hu [81.182.50.9]) by fe04.axelero.hu (8.12.11/8.12.11) with ESMTP id i9UIiw2c060399 for ; Sat, 30 Oct 2004 20:44:58 +0200 (CEST) Message-ID: <4183E133.1050103@avalon.aut.bme.hu> Date: Sat, 30 Oct 2004 20:45:07 +0200 User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: operator strange behaviour From: felho@avalon.aut.bme.hu (Hodicska Gergely) Hi! I tried to get answer on the general list, but I didn't get. I have a little example, which generate strange output. $a = 0; $b = 1; if ($a = 1 && $b = 0) { echo 'true '; var_dump($a); var_dump($b); } else { echo 'false '; var_dump($a); var_dump($b); } Runing this we get: "flase bool(false) int(0)" After the precedence table the first step should be evaluating the &&, and we get something like this: $a = false = 0, which should generate an error, while there isn't an "lvalue" on the left side of the =. But doesn't this happen. It seems, that the evaluation of the first = came before evaluating the &&. Can someone exactly explain how PHP process this condition? THX in advance, Felho