note 76406 added to language.types.boolean

From: Date: Fri, 13 Jul 2007 15:22:22 +0000
Subject: note 76406 added to language.types.boolean
Groups: php.notes 
Request: Send a blank email to php-notes+get-128441@lists.php.net to get a copy of this message
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 @+ ---- Server IP: 194.145.210.3 Probable Submitter: 80.169.153.20 ---- Manual Page -- http://www.php.net/manual/en/language.types.boolean.php Edit -- https://master.php.net/note/edit/76406 Del: integrated -- https://master.php.net/note/delete/76406/integrated Del: useless -- https://master.php.net/note/delete/76406/useless Del: bad code -- https://master.php.net/note/delete/76406/bad+code Del: spam -- https://master.php.net/note/delete/76406/spam Del: non-english -- https://master.php.net/note/delete/76406/non-english Del: in docs -- https://master.php.net/note/delete/76406/in+docs Del: other reasons-- https://master.php.net/note/delete/76406 Reject -- https://master.php.net/note/reject/76406 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#128441) next »