note 124288 rejected from function.empty by cmb
| From: | cmb@php.net | Date: | Fri, 11 Oct 2019 20:55:44 +0000 |
| Subject: | note 124288 rejected from function.empty by cmb | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-212577@lists.php.net to get a copy of this message | ||
Note Submitter: info at ugurbicer dot com dot tr
----
$a = '' or '0' or false or 0 or null or what else..
<?php
$a = function(){
$arr = ['', 0, '0', false, null];
return $arr[rand(0,4)];
};
$a = $a();
if (! $a) {
var_dump($a);
}
if (empty($a)) {
var_dump($a);
}
?>
results : all passed
so, what is the difference between empty function and "!" operator?