3v4l.org

run code in 200+ 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 4.3.0 - 7.1.10
1 - 0 1 - 0 0 - 0 0 - 0