Created
January 30, 2015 12:03
-
-
Save mheap/3cb1d3f0d8bc8564af92 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
// Interestingly, a null value in an isset() check will return false | |
$r = array( | |
"a" => 1, | |
"b" => null | |
); | |
echo "a: ".(isset($r['a']) ? 'Yes' : 'No').PHP_EOL; | |
echo "b: ".(isset($r['b']) ? 'Yes' : 'No').PHP_EOL; | |
echo "c: ".(isset($r['c']) ? 'Yes' : 'No').PHP_EOL; | |
/* | |
* $ php a.php | |
* a: Yes | |
* b: No | |
* c: No | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment