Skip to content

Instantly share code, notes, and snippets.

@glennpratt
Created March 5, 2012 22:43
Show Gist options
  • Save glennpratt/1981690 to your computer and use it in GitHub Desktop.
Save glennpratt/1981690 to your computer and use it in GitHub Desktop.
<?php
function test($x, $y, $z) {
var_dump(($x || $y) && ($z || $y));
var_dump(($x && $z) || $y);
}
test(TRUE, TRUE, TRUE);
test(TRUE, FALSE, TRUE);
test(TRUE, TRUE, FALSE);
test(FALSE, FALSE, TRUE);
test(FALSE, TRUE, FALSE);
test(TRUE, FALSE, FALSE);
test(TRUE, FALSE, TRUE);
test(FALSE, TRUE, TRUE);
test(FALSE, FALSE, FALSE);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment