- 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? :)
On Wed, May 14, 2008 at 8:42 PM, Greg Sabino Mullane greg@endpoint.com 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? :)
Whoa, I didn't see that. WTF?
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
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
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? :)
Yeah, we killed that one. :)
- -- brion
wikitech-l@lists.wikimedia.org