note 119460 added to language.types.boolean

From: Date: Sat, 11 Jun 2016 12:22:34 +0000
Subject: note 119460 added to language.types.boolean
Groups: php.notes 
Request: Send a blank email to php-notes+get-205688@lists.php.net to get a copy of this message
Actually from a complete noob point of view 0 resulting in false makes sense as many languages as I have been taught consider the value 1 as true and the value 0 as false a simple boolean value. So lets says you think you set a variable to 0 and some how or another through your code this value has implicitly become and string instead of a int or boolean. Should PHP now consider it to evaluate to false. I wouldn't think so but hey I'm a PHP noob so perhaps I'm missing why you would ever want a "0" string to evaluate to true. ---- Server IP: 72.52.91.14 Probable Submitter: 202.161.110.90 ---- Manual Page -- http://php.net/manual/en/language.types.boolean.php Edit -- https://master.php.net/note/edit/119460 Del: integrated -- https://master.php.net/note/delete/119460/integrated Del: useless -- https://master.php.net/note/delete/119460/useless Del: bad code -- https://master.php.net/note/delete/119460/bad+code Del: spam -- https://master.php.net/note/delete/119460/spam Del: non-english -- https://master.php.net/note/delete/119460/non-english Del: in docs -- https://master.php.net/note/delete/119460/in+docs Del: other reasons-- https://master.php.net/note/delete/119460 Reject -- https://master.php.net/note/reject/119460 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#205688) next »