ID: 42662 Comment by: carsten_sttgt at gmx dot de Reported By: thug at thug dot fr Status: Open Bug Type: Unknown/Other Function Operating System: win XP PHP Version: 5.2.4 New Comment:
First one question: You have interchanged expected and actual result? If yes, that's the correct behaviour: If the first expression from the AND operator evaluate the FALSE, it make's no sense to test the rest, because the complete statement can't be TRUE anymore. (with the AND/&& operator all expressions must be true) e.g.: | if( $bool && fct($a) && fct($b)) - Only if $bool == true, fct($a) will be executed - Only if $bool == true and fct($a) returns true, fct($b) will be executed Previous Comments: ------------------------------------------------------------------------ [2007-09-13 17:36:18] thug at thug dot fr Description: ------------ When using a function in a if() condition, the function is not always launched. Reproduce code: --------------- if( !$something && !aff_new_com('news', $last_time) && !aff_new_com('ftp', $last_time) ) Expected result: ---------------- if( $bool && fct($a) && fct($b)) Then fct($a) and fct($b) are not launched if( funcct($a) && $bool && fct($b)) Then fct($a) is launched but not fct($b) fct return always true or false Actual result: -------------- All functions in the if should be launched. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=42662&edit=1