Re: PHP 4.0 Bug #4751 Updated: fopen within if is not executed
| From: | (Stefan Frings) | Date: | Thu, 01 Jun 2000 14:04:54 +0000 |
| Subject: | Re: PHP 4.0 Bug #4751 Updated: fopen within if is not executed | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-20001@lists.php.net to get a copy of this message | ||
But that is exacly what I want. The second file should only be opened if the
first was opened successfully.
My mistake was that I had to set parantheses. It looked like a bug to me
because this code worked fine in PHP 3.
You wrote:
mixing assignments (or any other operation that is
not free of side-effects) with logical operators
is generally not a good idea as php (similar to C
and others) uses an optimization technique called
"lazy evaluation"
so if you have an expression like
expr_a && expr_b
and expr_a evaluates to false, then expr_b is never
evaluated as the overall result of the '&&' would
be false anyway
______________________________
Homepage: http://www.edvfrings.de