Re: reason for a "Notice:.." on one site but not another? (Same code.)

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

 



On Mon, Aug 10, 2009 at 1:50 PM, Ralph Deffke<ralph_deffke@xxxxxxxx> wrote:
> this is not "intelligence" its just pure math. the '&&' says if BOTH
> expressions are true then the whole expression is true.
>
> so if the first one is false, the whole is false, why checking the next one
> in the underlaying C it would be something like this
> {
> if ( expression == false ) return false;
> if ( expression == false) return false;
> return true;
> }
>
> ralph
> ralph_deffke@xxxxxxxx

That's logically correct, and while PHP does implement this
"short-circuit" logic, not all languages do. In that regard, I
appreciate what John meant by saying it makes it look "more
intelligent." Some languages evaluate each of the conditions to their
respective boolean results before evaluating the logical operators.

Andrew

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