3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr = [ [key1] => 'foobar', [key2] => [ [key2-1] => [], [key2-2] => 'foo', [key2-3] => 'foo2', [key2-4] => 'foo3' ], ];
based on iENU4
Output for 7.2.0 - 7.2.4
Warning: Use of undefined constant key1 - assumed 'key1' (this will throw an Error in a future version of PHP) in /in/g1VPr on line 4 Warning: Illegal offset type in /in/g1VPr on line 4 Warning: Use of undefined constant key2 - assumed 'key2' (this will throw an Error in a future version of PHP) in /in/g1VPr on line 5 Warning: Use of undefined constant key2 - assumed 'key2' (this will throw an Error in a future version of PHP) in /in/g1VPr on line 6 Warning: A non-numeric value encountered in /in/g1VPr on line 6 Warning: Illegal offset type in /in/g1VPr on line 4 Warning: Use of undefined constant key2 - assumed 'key2' (this will throw an Error in a future version of PHP) in /in/g1VPr on line 7 Warning: A non-numeric value encountered in /in/g1VPr on line 7 Warning: Illegal offset type in /in/g1VPr on line 7 Warning: Use of undefined constant key2 - assumed 'key2' (this will throw an Error in a future version of PHP) in /in/g1VPr on line 8 Warning: A non-numeric value encountered in /in/g1VPr on line 8 Warning: Illegal offset type in /in/g1VPr on line 8 Warning: Use of undefined constant key2 - assumed 'key2' (this will throw an Error in a future version of PHP) in /in/g1VPr on line 9 Warning: A non-numeric value encountered in /in/g1VPr on line 9 Warning: Illegal offset type in /in/g1VPr on line 9 Warning: Illegal offset type in /in/g1VPr on line 9
Output for 7.1.0 - 7.1.16
Notice: Use of undefined constant key1 - assumed 'key1' in /in/g1VPr on line 4 Warning: Illegal offset type in /in/g1VPr on line 4 Notice: Use of undefined constant key2 - assumed 'key2' in /in/g1VPr on line 5 Notice: Use of undefined constant key2 - assumed 'key2' in /in/g1VPr on line 6 Warning: A non-numeric value encountered in /in/g1VPr on line 6 Warning: Illegal offset type in /in/g1VPr on line 4 Notice: Use of undefined constant key2 - assumed 'key2' in /in/g1VPr on line 7 Warning: A non-numeric value encountered in /in/g1VPr on line 7 Warning: Illegal offset type in /in/g1VPr on line 7 Notice: Use of undefined constant key2 - assumed 'key2' in /in/g1VPr on line 8 Warning: A non-numeric value encountered in /in/g1VPr on line 8 Warning: Illegal offset type in /in/g1VPr on line 8 Notice: Use of undefined constant key2 - assumed 'key2' in /in/g1VPr on line 9 Warning: A non-numeric value encountered in /in/g1VPr on line 9 Warning: Illegal offset type in /in/g1VPr on line 9 Warning: Illegal offset type in /in/g1VPr on line 9
Output for hhvm-3.22.0
Notice: Use of undefined constant key1 - assumed 'key1' in /in/g1VPr on line -1 Warning: Invalid operand type was used: Invalid type used as key in /in/g1VPr on line -1 Notice: Use of undefined constant key2 - assumed 'key2' in /in/g1VPr on line -1 Notice: Use of undefined constant key2 - assumed 'key2' in /in/g1VPr on line -1 Warning: Invalid operand type was used: Invalid type used as key in /in/g1VPr on line -1 Notice: Use of undefined constant key2 - assumed 'key2' in /in/g1VPr on line -1 Warning: Invalid operand type was used: Invalid type used as key in /in/g1VPr on line -1 Notice: Use of undefined constant key2 - assumed 'key2' in /in/g1VPr on line -1 Warning: Invalid operand type was used: Invalid type used as key in /in/g1VPr on line -1 Notice: Use of undefined constant key2 - assumed 'key2' in /in/g1VPr on line -1 Warning: Invalid operand type was used: Invalid type used as key in /in/g1VPr on line -1 Warning: Invalid operand type was used: Invalid type used as key in /in/g1VPr on line -1
Output for hhvm-3.18.5 - 3.21.3
Notice: Use of undefined constant key1 - assumed 'key1' in /in/g1VPr on line 4 Warning: Invalid operand type was used: Invalid type used as key in /in/g1VPr on line 4 Notice: Use of undefined constant key2 - assumed 'key2' in /in/g1VPr on line 5 Notice: Use of undefined constant key2 - assumed 'key2' in /in/g1VPr on line 6 Warning: Invalid operand type was used: Invalid type used as key in /in/g1VPr on line 6 Notice: Use of undefined constant key2 - assumed 'key2' in /in/g1VPr on line 7 Warning: Invalid operand type was used: Invalid type used as key in /in/g1VPr on line 7 Notice: Use of undefined constant key2 - assumed 'key2' in /in/g1VPr on line 8 Warning: Invalid operand type was used: Invalid type used as key in /in/g1VPr on line 8 Notice: Use of undefined constant key2 - assumed 'key2' in /in/g1VPr on line 9 Warning: Invalid operand type was used: Invalid type used as key in /in/g1VPr on line 9 Warning: Invalid operand type was used: Invalid type used as key in /in/g1VPr on line 10
Output for 5.6.0 - 5.6.30
Notice: Use of undefined constant key1 - assumed 'key1' in /in/g1VPr on line 4 Warning: Illegal offset type in /in/g1VPr on line 4 Notice: Use of undefined constant key2 - assumed 'key2' in /in/g1VPr on line 5 Notice: Use of undefined constant key2 - assumed 'key2' in /in/g1VPr on line 6 Warning: Illegal offset type in /in/g1VPr on line 6 Notice: Use of undefined constant key2 - assumed 'key2' in /in/g1VPr on line 7 Warning: Illegal offset type in /in/g1VPr on line 7 Notice: Use of undefined constant key2 - assumed 'key2' in /in/g1VPr on line 8 Warning: Illegal offset type in /in/g1VPr on line 8 Notice: Use of undefined constant key2 - assumed 'key2' in /in/g1VPr on line 9 Warning: Illegal offset type in /in/g1VPr on line 10 Warning: Illegal offset type in /in/g1VPr on line 10