note 116172 deleted from language.types.null by salathe
| From: | salathe@php.net | Date: | Fri, 21 Nov 2014 14:51:55 +0000 |
| Subject: | note 116172 deleted from language.types.null by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-200976@lists.php.net to get a copy of this message | ||
Note Submitter: naitsabes dot pawlak at gmail dot com
----
'==' 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