On 25 October 2012 18:38, Sebastian Krebs <krebs....@gmail.com> wrote: > 2012/10/25 crankypuss <fullm...@newsguy.com> >> Booleans ought to be 1 and 0. Casting a boolean to 2 is just wrong, a way >> to fix badly written code a few people have written and in so doing risk >> the breakage of far more code that is correct. > > > Thats not completely true. Boolean 'false' is equal to 0 and Boolean 'true' > is something different than 0, that _may_ be 1 (and in most cases is), but > it's not limited too. Just said.
In general that's true, but the PHP manual explicitly documents the result of a boolean to integer conversion as 0 and 1: http://au1.php.net/types.integer Adam -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php