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". empty($val) .PHP_EOL; }
Output for 4.3.10 - 4.4.9, 5.0.2 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 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
string_empty 1PHP_EOLstring_bool_f PHP_EOLstring_bool_t PHP_EOLint_0 1PHP_EOLint_1 PHP_EOLint_neg PHP_EOLint_norm PHP_EOLarray_empty 1PHP_EOLarray_null_val PHP_EOL