I not understand little bit. Simple switch statement not working correctly with zero value (=0
):
//$result = $sql->fetchColumn();
$result = 1;
switch ($result) {
case $result <= 2 :
throw new Exception('Error!');
break;
}
Problem is when $result = 0
then output should be 'error' but in this case script passing this validation. Weird question but i can't find a problem.