3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php error_reporting(-1); $null = null; $arr = array(); $str = 'string'; $int = 7; $dbl = 7.3; $bool = true; $obj = new stdClass(); echo $null['nope']; echo $null['nope']['sure']; $null['nope'][] = 'wat!?!'; echo $null['nope'][]; echo $arr['nope']; echo $arr['nope']['sure']; $arr['nope'][] = 'wat!?!'; echo $arr['nope'][]; echo $str['nope']; echo $str['nope']['sure']; $str['nope'][] = 'wat!?!'; echo $str['nope'][]; echo $int['nope']; echo $int['nope']['sure']; $int['nope'][] = 'wat!?!'; echo $int['nope'][]; echo $dbl['nope']; echo $dbl['nope']['sure']; $dbl['nope'][] = 'wat!?!'; echo $dbl['nope'][]; echo $bool['nope']; echo $bool['nope']['sure']; $bool['nope'][] = 'wat!?!'; echo $bool['nope'][]; echo $obj['nope']; echo $obj['nope']['sure']; $obj['nope'][] = 'wat!?!'; echo $obj['nope'][];
Output for 4.3.2 - 5.4.29
Fatal error: Cannot use [] for reading in /in/NnYWM on line 16
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot use [] for reading in /in/NnYWM on line 16