Created
August 16, 2014 19:26
-
-
Save expalmer/5f1693761a94c215cb23 to your computer and use it in GitHub Desktop.
Vazio é true ou false ? by @wbruno
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 | |
$ php -r "var_dump( (boolean)'') .PHP_EOL;" | |
bool(false) | |
# NodeJs | |
$ node | |
> !!"" | |
false | |
# ShellScript | |
$ vim boolean.sh | |
if [ "" = true ] ; then | |
echo 'true' | |
else | |
echo 'false' | |
fi | |
:wq! | |
$ sh boolean.sh | |
false | |
# Ruby | |
$ irb | |
> !!"" | |
(irb):1: warning: string literal in condition | |
=> true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment