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) { $empty = empty($val) ? 'true' : 'false'; printf("%-10.10s %5.5s\n", $name, $empty); }
Output for 4.3.2 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
string_emp true string_boo false string_boo false int_0 true int_1 false int_neg false int_norm false array_empt true array_null false
Output for 4.3.0 - 4.3.1
string_empty true string_bool_f false string_bool_t false int_0 true int_1 false int_neg false int_norm false array_empty true array_null_val false