Skip to content

Instantly share code, notes, and snippets.

@cho45
Last active October 6, 2015 07:38
Show Gist options
  • Save cho45/b7afadd615e454374a93 to your computer and use it in GitHub Desktop.
Save cho45/b7afadd615e454374a93 to your computer and use it in GitHub Desktop.
#!php
<?php
$targets = array(
array(),
NULL,
false,
0,
"",
"0",
"00",
"0.0",
" ",
"\x00",
true
);
echo "<table>";
echo "<tr><th></th>";
foreach ($targets as $b) {
echo "<th>";
var_dump($b);
echo "</th>";
}
echo "</tr>";
foreach ($targets as $a) {
echo "<tr>";
echo "<th>";
var_dump($a);
echo "</th>";
foreach ($targets as $b) {
echo "<td>";
echo $a == $b ? "<font color=green>true</font" : "<font color=red>false</font>";
echo "</td>";
}
echo "</tr>";
}
echo "</table>";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment