Buy Now
Sign in

Switch function strict equal comparison

emmexx , September 28 at 07:10
E
emmexx
I don't know if the following is by design but it can give unexpected results if you don't know it.
I created a switch that checks if a variable is empty or not:
{var/empty:my_var}
Something was wrong with the switch so in the Values Setup I put:
A:{success:my_var is empty}
When I test the code and my_var is empty the success message is displayed.
I suppose that A is evaluated as true. The code in switch_output.php is indeed:
$test_result = (($data == $target_value) OR ($target_value === '*'));
Using === instead of a loose equality would be a problem for the switch function?
maxx