3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $expected_array_got_string = 'somestring'; var_dump(empty($expected_array_got_string['some_key'])); var_dump(empty($expected_array_got_string[0])); var_dump(empty($expected_array_got_string['0'])); var_dump(empty($expected_array_got_string[0.5])); var_dump(empty($expected_array_got_string['0.5'])); var_dump(empty($expected_array_got_string['0 Mostel'])); ?>
Output for 5.4.0 - 5.6.27, hhvm-3.10.0 - 3.13.2, 7.0.0 - 7.1.0
bool(true) bool(false) bool(false) bool(false) bool(true) bool(true)
Output for 4.3.0 - 4.4.9, 5.0.3 - 5.3.29
bool(false) bool(false) bool(false) bool(false) bool(false) bool(false)
Output for 5.0.0 - 5.0.2
bool(true) bool(false) bool(true) bool(true) bool(true) bool(true)