null with PHP < and > operators -
can explain how null mapped in these statements?
null>0; //=> bool(false) null<0; //=> bool(false) null==0; //=> bool(true) but
null<-1; // => bool(true) i assume it's mapping problem, can't crack it.
tried php 5.3.5-1 suhosin-patch.
i point few pages: http://php.net/manual/en/types.comparisons.php http://php.net/manual/en/language.operators.comparison.php http://php.net/manual/en/language.types.boolean.php
so in final example:
null<-1 => bool(true) the null cast false , -1 cast true, false less true
in first 2 examples null cast false , 0 cast false, false not less or greater false equal it.
ohh fun of null ! :d
Comments
Post a Comment