Created
May 15, 2014 14:47
-
-
Save MacDada/99031392946006f65b71 to your computer and use it in GitHub Desktop.
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 | |
function should_return_array_or_nothing1() { | |
return false; | |
} | |
function should_return_array_or_nothing2() { | |
return null; | |
} | |
var_dump((array) should_return_array_or_nothing1()); | |
// array(1) { [0]=> bool(false) } | |
var_dump((array) should_return_array_or_nothing2()); | |
// array(0) { } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment