Skip to content

Instantly share code, notes, and snippets.

@bradhe
Created April 27, 2015 17:37
Show Gist options
  • Save bradhe/addcd3ceb48a61eb1299 to your computer and use it in GitHub Desktop.
Save bradhe/addcd3ceb48a61eb1299 to your computer and use it in GitHub Desktop.
<?php
echo "Empty array false-y? " . (array() ? "No" : "Yes");
echo "\n";
echo "Array false-y? " . (array("hi") ? "No" : "Yes");
echo "\n";
echo "Associative array false-y? " . (array("hi" => "there") ? "No" : "Yes");
echo "\n";
bheller@~ ☁ [ruby-2.2.2] [2015-04-27 10:37:11] [1]
>> php falsy.php
Empty array false-y? Yes
Array false-y? No
Associative array false-y? No
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment