3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $test = array(); $test['eval_none'] = ''; $test['eval_zero'] = 0; $test['eval_null'] = null; $test['eval_false'] = false; $test['eval_true'] = true; var_dump('NONE-EXISTENT'); if (isset($test['eval_nonexixtent'])) var_dump('None-existent is set.'); if (!isset($test['eval_nonexixtent'])) var_dump('None-existent is not set.'); if (empty($test['eval_nonexixtent'])) var_dump('None-existent is empty.'); if (!empty($test['eval_nonexixtent'])) var_dump('None-existent is not empty.'); var_dump('-------------'); var_dump('NONE'); if (isset($test['eval_none'])) var_dump('None is set.'); if (!isset($test['eval_none'])) var_dump('None is not set.'); if (empty($test['eval_none'])) var_dump('None is empty.'); if (!empty($test['eval_none'])) var_dump('None is not empty.'); var_dump('-------------'); var_dump('ZERO'); if (isset($test['eval_zero'])) var_dump('Zero is set.'); if (!isset($test['eval_zero'])) var_dump('Zero is not set.'); if (empty($test['eval_zero'])) var_dump('Zero is empty.'); if (!empty($test['eval_zero'])) var_dump('Zero is not empty.'); var_dump('-------------'); var_dump('NULL'); if (isset($test['eval_null'])) var_dump('Null is set.'); if (!isset($test['eval_null'])) var_dump('Null is not set.'); if (empty($test['eval_null'])) var_dump('Null is empty.'); if (!empty($test['eval_null'])) var_dump('Null is not empty.'); var_dump('-------------'); var_dump('FALSE'); if (isset($test['eval_false'])) var_dump('False is set.'); if (!isset($test['eval_false'])) var_dump('False is not set.'); if (empty($test['eval_false'])) var_dump('False is empty.'); if (!empty($test['eval_false'])) var_dump('False is not empty.'); var_dump('-------------'); var_dump('TRUE'); if (isset($test['eval_true'])) var_dump('True is set.'); if (!isset($test['eval_true'])) var_dump('True is not set.'); if (empty($test['eval_true'])) var_dump('True is empty.'); if (!empty($test['eval_true'])) var_dump('True is not empty.'); var_dump('-------------');
based on oaYdv
Output for 4.3.0 - 7.2.0
string(13) "NONE-EXISTENT" string(25) "None-existent is not set." string(23) "None-existent is empty." string(13) "-------------" string(4) "NONE" string(12) "None is set." string(14) "None is empty." string(13) "-------------" string(4) "ZERO" string(12) "Zero is set." string(14) "Zero is empty." string(13) "-------------" string(4) "NULL" string(16) "Null is not set." string(14) "Null is empty." string(13) "-------------" string(5) "FALSE" string(13) "False is set." string(15) "False is empty." string(13) "-------------" string(4) "TRUE" string(12) "True is set." string(18) "True is not empty." string(13) "-------------"