3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $vars = [ 'TRUE' => TRUE, 'FALSE' => FALSE, '1' => 1, '0' => 0, '-1' => -1, '"1"' => "1", '"0"' => "0", '"-1"' => "-1", 'NULL' => NULL, 'array()' => array(), '"php"' => "php", '""' => "", ]; foreach ($vars as $label => $var) { $result = (!$var === empty($var)) ? 'TRUE' : 'FALSE'; echo sprintf("%s: %s\n", $label, $result); }
based on BZlHM
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.22.0, 7.0.0 - 7.2.2
TRUE: TRUE FALSE: TRUE 1: TRUE 0: TRUE -1: TRUE "1": TRUE "0": TRUE "-1": TRUE NULL: TRUE array(): TRUE "php": TRUE "": TRUE