I've been looking through Zend Framework's source code and noticed that most (if not all) comparisons are done with the operands in the reverse order I would expect:
if ((false !== $request) {
...
}
instead of:
if (($request !== false) {
...
}
What is the reason for this convention?
It's called a Left-Hand Comparison.
Basically, it's so that if you forget to put the second = in ==, it'll error rather change the value of the variable...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With