3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $primary = 0; echo ($primary || $primary === "0" || $primary === 0) ? 1 : 0; echo "\n\r"; echo ("- " . !empty($primary) ? 1 : 0;); echo "\n\r"; $primary = "0"; echo ($primary || $primary === "0" || $primary === 0) ? 1 : 0; echo "\n\r"; echo ("- " . !empty($primary) ? 1 : 0;); echo "\n\r"; $primary = NULL; echo ($primary || $primary === "0" || $primary === 0) ? 1 : 0; echo "\n\r"; echo ("- " . !empty($primary) ? 1 : 0;); echo "\n\r"; $primary = ''; echo ($primary || $primary === "0" || $primary === 0) ? 1 : 0; echo "\n\r"; echo ("- " . !empty($primary) ? 1 : 0;); echo "\n\r";
Output for 5.3.0 - 5.4.30
Parse error: syntax error, unexpected ';' in /in/2cDnW on line 6
Process exited with code 255.