3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php php > $a = 'abc'; php > $b = [ 1, 2, 3]; php > $a[0] = $b;
based on ETlbq
Output for 7.2.0
Warning: Use of undefined constant php - assumed 'php' (this will throw an Error in a future version of PHP) in /in/WsTnn on line 3 Warning: Use of undefined constant php - assumed 'php' (this will throw an Error in a future version of PHP) in /in/WsTnn on line 4 Warning: Use of undefined constant php - assumed 'php' (this will throw an Error in a future version of PHP) in /in/WsTnn on line 5 Notice: Array to string conversion in /in/WsTnn on line 5
Output for 5.4.0 - 7.1.10
Notice: Use of undefined constant php - assumed 'php' in /in/WsTnn on line 3 Notice: Use of undefined constant php - assumed 'php' in /in/WsTnn on line 4 Notice: Use of undefined constant php - assumed 'php' in /in/WsTnn on line 5 Notice: Array to string conversion in /in/WsTnn on line 5
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/WsTnn on line 4
Process exited with code 255.