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 "\tis_null:\t" . ( is_null($cosa) ? "TRUE" : "FALSE" ) . "\n"; echo "\tempty:\t" . ( empty($cosa) ? "TRUE" : "FALSE" ) . "\n\n"; }
based on vX4EU
Output for 4.3.0 - 7.1.0
* true isset: TRUE is_null: FALSE empty: FALSE * false isset: TRUE is_null: FALSE empty: TRUE * null isset: FALSE is_null: TRUE empty: TRUE * empty isset: TRUE is_null: FALSE empty: TRUE * positive isset: TRUE is_null: FALSE empty: FALSE * negative isset: TRUE is_null: FALSE empty: FALSE * zero isset: TRUE is_null: FALSE empty: TRUE