PHP 4.0 Bug #4037 Updated: improper parsing of logical statements
| From: | Oded Arbel | Date: | Tue, 15 Aug 2000 16:38:33 +0000 |
| Subject: | PHP 4.0 Bug #4037 Updated: improper parsing of logical statements | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-28981@lists.php.net to get a copy of this message | ||
OK, you are right - according to the manual, I should have used the logical
operator 'and' instead of '&&' .
I still think that this is wrong though, and misleading - high level
programming languages always set the logical operators (no matter how they
are named) as lower precedence then assignment operators (actually, the
lowest), and if you want a different behaviour then you use parenthesis.
I'd hate to sound like a conformist or something, but this is damaging to
people who start programming in PHP after doing a lot of high level
programming in other languages. (and it was different in PHP3 ;-)
Oded
P.S.
sorry this is going by email - I can't remember my password to the PHP bug
database. I hope you won't get mad at me.
----- Original Message -----
From: "Bug Database" <php-dev@lists.php.net>
To: <oded@geek.co.il>
Sent: Tuesday, August 15, 2000 4:10 PM
Subject: PHP 4.0 Bug #4037 Updated: improper parsing of logical statements
> ID: 4037
> Updated by: waldschrott
> Reported By: oded@geek.co.il
> Status: Closed
> Bug Type: Scripting Engine problem
> Assigned To:
> Comments:
>
> zak´s right, this is not a bug, maybe it was in PHP3,
> using () you´re forcing zend to evaluate the left part first (2), closed
>
> Full Bug description available at: http://bugs.php.net/?id=4037
>
>