3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $data = 'here\'s some data'; var_dump($data['string']); var_dump($data['string'][0]); var_dump($data[0][0]); var_dump($data[0][0][0]); var_dump($data[0][2][3]); var_dump($data[1]); var_dump($data[1][0]);
Output for 5.4.0 - 7.1.0
Warning: Illegal string offset 'string' in /in/HvAml on line 5 string(1) "h" Warning: Illegal string offset 'string' in /in/HvAml on line 6 string(1) "h" string(1) "h" string(1) "h" Notice: Uninitialized string offset: 2 in /in/HvAml on line 9 Notice: Uninitialized string offset: 3 in /in/HvAml on line 9 string(0) "" string(1) "e" string(1) "e"
Output for 5.0.0 - 5.3.29
string(1) "h" Fatal error: Cannot use string offset as an array in /in/HvAml on line 6
Process exited with code 255.
Output for 4.3.0 - 4.4.9
string(1) "h" NULL NULL NULL NULL string(1) "e" NULL