3v4l.org

run code in 300+ PHP versions simultaneously
<?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'])); echo (array)$expected_array_got_string['some_key']; echo $expected_array_got_string[0]; echo $expected_array_got_string['0']; echo $expected_array_got_string[0.6]; echo $expected_array_got_string['0.5']; echo $expected_array_got_string['0 Mostel'];

preferences:
42.29 ms | 402 KiB | 5 Q