Ну, это не совсем разбор, но вы можете оценить свое состояние по мере выполнения кода.
$condition = true;
if ($foo != 'Any') { $condition = $condition && ($this_foo == $foo);}
if ($bar != 'Any') { $condition = $condition && ($this_bar == $bar);}
if ($txt != 'Any') { $condition = $condition && ($this_txt == $txt);}
$condition = $condition && ($num1 > 0 && $num2 < 1000);
if ($condition)
{
someoperations
}
Итак, допустим, что $foo != 'Any'
равно true
, что приведет к
$condition = true && ($this_foo == $foo) && ($num1 > 0 && $num2 < 1000);
Давайте представим, что $this_foo == $foo
, $num1 == 45
и $num2 == 2300
$condition = true && true && (true && false);
$condition = false;
, а ваше if не выполнится.