What does the double not operator do in PHP?
For example:
return !! $row;
What would the code above do?
"not not" is a convenient way in many languages for understanding what truth value the language assigns to the result of any expression. For example, in Python:
>>> not not []
False
>>> not not [False]
True
It can be convenient in places where you want to reduce a complex value down to something like "is there a value at all?".