But the equal operator == is less strict than the identical operator === and can have some hard to predict results, so it’s typically better to only use the identical operator. Strings When comparing a string to an integer the string is evaluated as 0!! evaluates true because first “ABC” is converted to integer and […]
Category: If, Comparison, etc
? True False Test
Examples $MyVariable ? print “True” : print “False”;
Assign value in an if statement
If result is not false Note – make sure you surround the assignment and function call in brackets or it doesn’t work!
If
Logical OR Logical AND Not Equal When return value can be boolean or an integer Use if ($ReturnValue === false) or $ReturnValue !== false) If with load of a return value into a variable Ensure you enclose the assignment in brackets or it won’t work correctly