3 ms·
are you sure null < -1 is true? If it's the case what happens to 0 < -1?
by throwaway8748 6y ago
are you sure null < -1 is true? If it's the case what happens to 0 < -1?
- zozbot234 6y agoWell, -1 is just 0x…FFFFF, right? So any number is lesser than -1. I rest my case.
- xellisx 6y agoTo test all cases and make sure there there isn't any weird cases (Run on PHP 7.2): <?php if (null > -1) { echo "null > -1\n"; } if (null < -1) { echo "null < -1\n"; } if (null == -1) { echo "null == -1\n"; } if (null === -1) { echo "null === -1\n"; } if (0 < -1) { echo "0 < -1\n"; } if (0 > -1) { echo "0 > -1\n"; } if (0 == -1) { echo "0 == -1\n"; } if (0 === -1) { echo "0 === -1\n"; } results: null < -1 0 > -1