note 116172 added to language.types.null

From: Date: Tue, 18 Nov 2014 13:10:35 +0000
Subject: note 116172 added to language.types.null
Groups: php.notes 
Request: Send a blank email to php-notes+get-200945@lists.php.net to get a copy of this message
'==' is comparison operator which gives true if both sides are equal after type juggling. When you are comparing bool or null with anything, then both sides are converted to bool. So when you are comparing null with empty array or empty string, then null is converted to FALSE, empty string is converted to FALSE and empty array is converted to FALSE. array() == NULL '' == NULL both are converted to FALSE == FALSE which gives of course TRUE ---- Server IP: 72.52.91.14 Probable Submitter: 84.10.190.187 ---- Manual Page -- http://php.net/manual/en/language.types.null.php Edit -- https://master.php.net/note/edit/116172 Del: integrated -- https://master.php.net/note/delete/116172/integrated Del: useless -- https://master.php.net/note/delete/116172/useless Del: bad code -- https://master.php.net/note/delete/116172/bad+code Del: spam -- https://master.php.net/note/delete/116172/spam Del: non-english -- https://master.php.net/note/delete/116172/non-english Del: in docs -- https://master.php.net/note/delete/116172/in+docs Del: other reasons-- https://master.php.net/note/delete/116172 Reject -- https://master.php.net/note/reject/116172 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#200945) next »