The assertion of a PHP statement does not behave like most other languages.
assert ('return false'); actually evaluates the string and then claims its result (false).
Instead of comparing the parameter with the true one, it goes through an additional step of checking the argument and, if it evaluates it, then performs the comparison.
Very strange.
My problem is not understanding behavior, my problem arises with a good reason for this behavior, especially. since now you need to do additional mental work of thinking ... "does it evaluate the string?".
thanks
source
share