Skip to content

Instantly share code, notes, and snippets.

@tobsn
Created April 24, 2014 15:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tobsn/11258483 to your computer and use it in GitHub Desktop.
Save tobsn/11258483 to your computer and use it in GitHub Desktop.
php false true null horse;
<?php
echo true ? 'car' : true ? 'horse' : 'feet'; #horse
echo true ? 'car' : false ? 'horse' : 'feet'; #horse
echo false ? 'car' : false ? 'horse' : 'feet'; #feet
echo false ? 'car' : true ? 'horse' : 'feet'; #horse
echo false ? 'car' : null ? 'horse' : 'feet'; #feet
echo true ? 'car' : null ? 'horse' : 'feet'; #horse
echo null ? 'car' : null ? 'horse' : 'feet'; #feet
echo null ? 'car' : false ? 'horse' : 'feet'; #feet
echo null ? 'car' : true ? 'horse' : 'feet'; #horse
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment