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) { if (!empty($val)) { echo "$name isn't considered empty!"; } }
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
string_bool_f isn't considered empty!string_bool_t isn't considered empty!int_1 isn't considered empty!int_neg isn't considered empty!int_norm isn't considered empty!array_null_val isn't considered empty!