Greg Sabino Mullane wrote:
- Move $var ? true : false check to boolval function
...
+function boolval( $val ) {
- return $val ? true : false;
+}
What's the point of this function? Should we start creating things like function equalto( $val1, $val2 ) as well? :)
Perhaps Vasilev was put off by the verbose syntax "$val ? true : false". The same behaviour can be obtained with "(bool)$val" or "!!$val", which are both briefer and faster than either of his versions.
-- Tim Starling