If the value of the variable is 0 (float), it will pass all these tests:
$test = round(0, 2); //$test=(float)0 if($test == null) echo "var is null"; if($test == 0) echo "var is 0"; if($test == false) echo "var is false"; if($test==false && $test == 0 && $test==null) echo "var is mixture";
I assumed that it will pass only if ($ test == 0)
Only the solution found discovers that if $ test is a number using the is_number () function, but can I determine if the float variable is equal to zero?
decimal php zero detect
mrfazolka
source share