Created
May 12, 2021 19:08
-
-
Save ppazos/6dc486c214e99f0d2662f5ce5bc7339a to your computer and use it in GitHub Desktop.
Tests falsy values which compared to false give true
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$items = array( | |
array(), | |
0, | |
'', | |
null | |
); | |
function is_false($v) | |
{ | |
return $v == false; | |
} | |
$r = array_map('is_false', $items); | |
var_dump($r); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment