Created
March 4, 2021 21:10
-
-
Save tim-cotten/7dc94b110f1a65878a55a6519260bcf5 to your computer and use it in GitHub Desktop.
PHP Bugs: Confusing Non-Objects for Objects (Example C)
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 | |
// ... Missile Command API called ... | |
$api_result = "{launch_verification:false,msg:'abort'}"; | |
$result = json_decode($api_result); | |
if (isset($result->launch_verification) && $result->launch_verification == true) { | |
echo "Launching nuclear missiles."; | |
launch_missiles(); | |
exit(); | |
} | |
echo "Terminating launch sequence."; | |
// Output: | |
// Terminating launch sequence. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment