3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $expected_array_got_string = 'somestring'; var_dump($expected_array_got_string['some_key']); var_dump($expected_array_got_string[0]); var_dump($expected_array_got_string['0']); var_dump($expected_array_got_string[0.5]); var_dump($expected_array_got_string['0.5']); var_dump($expected_array_got_string['0 Mostel']); ?>
based on gOaef
Output for 5.4.5 - 7.2.0
Warning: Illegal string offset 'some_key' in /in/KtWQ8 on line 3 string(1) "s" string(1) "s" string(1) "s" Notice: String offset cast occurred in /in/KtWQ8 on line 6 string(1) "s" Warning: Illegal string offset '0.5' in /in/KtWQ8 on line 7 string(1) "s" Notice: A non well formed numeric value encountered in /in/KtWQ8 on line 8 string(1) "s"
Output for 5.4.0 - 5.4.4
Warning: Illegal string offset 'some_key' in /in/KtWQ8 on line 3 string(1) "s" string(1) "s" string(1) "s" Notice: String offset cast occured in /in/KtWQ8 on line 6 string(1) "s" Warning: Illegal string offset '0.5' in /in/KtWQ8 on line 7 string(1) "s" Notice: A non well formed numeric value encountered in /in/KtWQ8 on line 8 string(1) "s"
Output for 4.3.0 - 5.3.29
string(1) "s" string(1) "s" string(1) "s" string(1) "s" string(1) "s" string(1) "s"