note 76406 deleted from language.types.boolean by danbrown

From: Date: Thu, 18 Jun 2009 14:11:17 +0000
Subject: note 76406 deleted from language.types.boolean by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-157080@lists.php.net to get a copy of this message
Note Submitter: openspecies ---- function is_odd($x) { return ($x & 1); //integer } function is_even($x) { return (!($x & 1)); //integer } if(is_even(10) === TRUE) // NO function is_odd($x) { return (bool) ($x & 1); //boolean } function is_even($x) { return (bool) (!($x & 1)); //boolean } if(is_even(10) === TRUE) // YES $str = 'Hello World!'; if($str === TRUE) // ecetera @+

« previous php.notes (#157080) next »