3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $values = array( 'string_empty' => '', 'string_bool_f' => 'false', 'string_bool_t' => 'true', 'int_0' => 0, 'int_1' => 1, 'int_neg' => -100, 'int_norm' => 100, 'array_empty' => array(), 'array_null_val' => array(null), ); foreach ($values as $name => $val) { echo "$name\t\t\t". (bool) empty($val) .PHP_EOL; }
Output for 4.3.10 - 4.4.9, 5.0.2 - 7.1.0
string_empty 1 string_bool_f string_bool_t int_0 1 int_1 int_neg int_norm array_empty 1 array_null_val
Output for 4.3.0 - 4.3.9, 5.0.0 - 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/ejtvs on line 16 string_empty 1PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/ejtvs on line 16 string_bool_f PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/ejtvs on line 16 string_bool_t PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/ejtvs on line 16 int_0 1PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/ejtvs on line 16 int_1 PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/ejtvs on line 16 int_neg PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/ejtvs on line 16 int_norm PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/ejtvs on line 16 array_empty 1PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/ejtvs on line 16 array_null_val PHP_EOL