Skip to content

Instantly share code, notes, and snippets.

@DiegoSeC
Last active August 29, 2015 14:07
Show Gist options
  • Save DiegoSeC/7e17939dd00cb6a11feb to your computer and use it in GitHub Desktop.
Save DiegoSeC/7e17939dd00cb6a11feb to your computer and use it in GitHub Desktop.
<?php
// Returns the value of the expression, take care if you use isset or some function who evaluate the variable
// because will return true or the response of the function.
$x = "Hey";
echo $x ?: "The variable doesn't exist";
echo (isset($y) ?: "The variable doesn't exist");
$z = "This will return TRUE instead of this sentence";
echo (isset($z) ?: "The variable doesn't exist");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment