3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = array(); $a["x"] = "bb"; $a["x"][] = "cc"; print_r($a); print_r("A"); print_r(empty([])); print_r("A"); print_r(empty(array())); print_r("A"); print_r(empty($a)); print_r(array_merge([1,[2,3]],[1])); ?>
based on 9qjmt
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught Error: [] operator not supported for strings in /in/5fPDR:5 Stack trace: #0 {main} thrown in /in/5fPDR on line 5
Process exited with code 255.
Output for 5.5.24 - 5.6.28
Fatal error: [] operator not supported for strings in /in/5fPDR on line 5
Process exited with code 255.
Output for 5.3.19 - 5.4.45
Parse error: syntax error, unexpected '[' in /in/5fPDR on line 8
Process exited with code 255.