3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = false; $b = ''; $c = 0; $d = array(); var_dump($a['x']); var_dump($b['x']); var_dump($c['x']); var_dump($d['x']);
Output for 5.4.0 - 7.1.0
NULL Warning: Illegal string offset 'x' in /in/T3Bj8 on line 8 Notice: Uninitialized string offset: 0 in /in/T3Bj8 on line 8 string(0) "" NULL Notice: Undefined index: x in /in/T3Bj8 on line 10 NULL
Output for 5.3.0 - 5.3.29
NULL Notice: Uninitialized string offset: 0 in /in/T3Bj8 on line 8 string(0) "" NULL Notice: Undefined index: x in /in/T3Bj8 on line 10 NULL
Output for 5.2.10 - 5.2.17
NULL Notice: Uninitialized string offset: 0 in /in/T3Bj8 on line 8 string(0) "" NULL Notice: Undefined index: x in /in/T3Bj8 on line 10 NULL
Output for 4.3.0 - 5.2.9
NULL Notice: Uninitialized string offset: 0 in /in/T3Bj8 on line 8 string(0) "" NULL Notice: Undefined index: x in /in/T3Bj8 on line 10 NULL