In php, ($myvariable==0) When $myvariable is zero, the value of the expression is true; when $myvariable is null, the value of this expression is also true. How
($myvariable==0)
Try ($myvariable === 0) which will not perform type coercion.
($myvariable === 0)