3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array('one', 'two', 'three', 'four'); $i = sizeof($a); $j = 0; $array=""; for($j=0;$j<$i-1;$j++) { $array[] = $a[$j]." ".$a[$j+1]; } print_r($array);
Output for 7.1.0
Fatal error: Uncaught Error: [] operator not supported for strings in /in/skUv5:8 Stack trace: #0 {main} thrown in /in/skUv5 on line 8
Process exited with code 255.
Output for 4.3.0 - 7.0.14
Array ( [0] => one two [1] => two three [2] => three four )