3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $cosas = array( 'true' => TRUE, 'false' => FALSE, 'null' => NULL, 'empty' => "", 'positive' => 1, 'negative' => -1, 'zero' => 0 ); foreach($cosas as $nombre => $cosa) { echo "* $nombre\n"; echo "\tisset:\t" . ( isset($cosa) ? "TRUE" : "FALSE" ) . "\n"; echo "\tisnull:\t" . ( is_null($cosa) ? "TRUE" : "FALSE" ) . "\n"; echo "\tempty:\t" . ( empty($cosa) ? "TRUE" : "FALSE" ) . "\n\n"; }
based on bv7dm
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
* true isset: TRUE isnull: FALSE empty: FALSE * false isset: TRUE isnull: FALSE empty: TRUE * null isset: FALSE isnull: TRUE empty: TRUE * empty isset: TRUE isnull: FALSE empty: TRUE * positive isset: TRUE isnull: FALSE empty: FALSE * negative isset: TRUE isnull: FALSE empty: FALSE * zero isset: TRUE isnull: FALSE empty: TRUE