3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = array( 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h' ); for($i =0;$i<3;$i++){ array_push($array, array_shift($array)) ; } print_r($array) ;
based on SlfFP
Output for 5.6.0 - 5.6.30, hhvm-3.15.4, 7.0.0 - 7.2.0
Array ( [0] => d [1] => e [2] => f [3] => g [4] => h [5] => a [6] => b [7] => c )