3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $var1 = " "; $var2 = " "; $var1[0] = $var2[0] = "1"; $var1[1] = "2"; $var2[1] = "3"; $var1[2] = $var2[2] = "4"; $var1[3] = $var2[3] = "5"; echo 'Var1: ' . $var1 . ', Var2: ' . $var2;
Output for 4.3.3 - 5.2.9, 5.2.12 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Var1: 1245, Var2: 1345
Output for 5.2.10 - 5.2.11
Notice: Uninitialized string offset: 1 in /in/DYXu2 on line 6 Notice: Uninitialized string offset: 1 in /in/DYXu2 on line 7 Notice: Uninitialized string offset: 2 in /in/DYXu2 on line 8 Notice: Uninitialized string offset: 2 in /in/DYXu2 on line 8 Notice: Uninitialized string offset: 3 in /in/DYXu2 on line 9 Notice: Uninitialized string offset: 3 in /in/DYXu2 on line 9 Var1: 1245, Var2: 1345
Output for 4.3.0 - 4.3.2
Var1: 2, Var2: 1345