I'd be willing to bet it did not;

I often use;

if(isset($var) && $var != "") xxxxx

second test above would generate error if $var was not valid and the second
test was executed anyway.  The key is the && between the two tests, first
one fails, no need to test the second, probably lifted right out of the C
compiler implementation and syntax.


Warren Vail
Tools, Metrics & Quality Processes
(415) 667-7814
Pager (877) 774-9891
215 Fremont 02-658


-----Original Message-----
From: Asendorf, John [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 1:39 PM
To: Php-Windows (E-mail)
Subject: [PHP-WIN] Multiple conditions in an if statement


I have a question about the efficiency of an if statement...

Say you have the following statement,

if ( $i == 6 && eregi ( "foo" , $bar ) ) {  }

And the first portion ( $i == 6 ) IS NOT true, does PHP even attempt to run
the regular expression?

Just wondering.

Thanks,
John

---------------------
John Asendorf - [EMAIL PROTECTED]
Web Applications Developer
http://www.lcounty.com - NEW FEATURES ADDED DAILY!
Licking County, Ohio, USA
740-349-3631
Nullum magnum ingenium sine mixtura dementiae fuit

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to