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']; echo $null['nope'][] = 'wat!?!'; echo $arr['nope']; echo $arr['nope']['sure']; echo $arr['nope'][] = 'wat!?!'; echo $str['nope']; echo $str['nope']['sure']; echo $str['nope'][] = 'wat!?!'; echo $int['nope']; echo $int['nope']['sure']; echo $int['nope'][] = 'wat!?!'; echo $dbl['nope']; echo $dbl['nope']['sure']; echo $dbl['nope'][] = 'wat!?!'; echo $bool['nope']; echo $bool['nope']['sure']; echo $bool['nope'][] = 'wat!?!'; echo $obj['nope']; echo $obj['nope']['sure']; echo $obj['nope'][] = 'wat!?!';
Output for 7.0.0 - 7.1.0
wat!?! Notice: Undefined index: nope in /in/Y269Z on line 17 Notice: Undefined index: nope in /in/Y269Z on line 18 wat!?! Warning: Illegal string offset 'nope' in /in/Y269Z on line 21 s Warning: Illegal string offset 'nope' in /in/Y269Z on line 22 Warning: Illegal string offset 'sure' in /in/Y269Z on line 22 s Warning: Illegal string offset 'nope' in /in/Y269Z on line 23 Fatal error: Uncaught Error: Cannot use string offset as an array in /in/Y269Z:23 Stack trace: #0 {main} thrown in /in/Y269Z on line 23
Process exited with code 255.
Output for hhvm-3.12.0
wat!?! Notice: Undefined index: nope in /in/Y269Z on line 17 Notice: Undefined index: nope in /in/Y269Z on line 18 wat!?!ss Fatal error: Operator not supported for strings in /in/Y269Z on line 23
Process exited with code 255.
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.4.0 - 5.6.28
wat!?! Notice: Undefined index: nope in /in/Y269Z on line 17 Notice: Undefined index: nope in /in/Y269Z on line 18 wat!?! Warning: Illegal string offset 'nope' in /in/Y269Z on line 21 s Warning: Illegal string offset 'nope' in /in/Y269Z on line 22 Warning: Illegal string offset 'sure' in /in/Y269Z on line 22 s Warning: Illegal string offset 'nope' in /in/Y269Z on line 23 Fatal error: Cannot use string offset as an array in /in/Y269Z on line 23
Process exited with code 255.
Output for 5.3.0 - 5.3.29
wat!?! Notice: Undefined index: nope in /in/Y269Z on line 17 Notice: Undefined index: nope in /in/Y269Z on line 18 wat!?!s Fatal error: Cannot use string offset as an array in /in/Y269Z on line 22
Process exited with code 255.
Output for 5.0.0 - 5.2.17
wat!?! Notice: Undefined index: nope in /in/Y269Z on line 17 Notice: Undefined index: nope in /in/Y269Z on line 18 wat!?!s Fatal error: Cannot use string offset as an array in /in/Y269Z on line 22
Process exited with code 255.
Output for 4.3.0 - 4.4.9
wat!?! Notice: Undefined index: nope in /in/Y269Z on line 17 Notice: Undefined index: nope in /in/Y269Z on line 18 wat!?!s Warning: Cannot use a scalar value as an array in /in/Y269Z on line 27 Warning: Cannot use a scalar value as an array in /in/Y269Z on line 31 Warning: Cannot use a scalar value as an array in /in/Y269Z on line 35 Warning: Cannot use a scalar value as an array in /in/Y269Z on line 39