Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ppazos
Created May 12, 2021 19:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ppazos/6dc486c214e99f0d2662f5ce5bc7339a to your computer and use it in GitHub Desktop.
Save ppazos/6dc486c214e99f0d2662f5ce5bc7339a to your computer and use it in GitHub Desktop.
Tests falsy values which compared to false give true
<?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