3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $maxQty = 20; $productQtyArray = range(1, $maxQty, 1); array_unshift($productQtyArray); unset($productQtyArray[0]); print_r($productQtyArray);
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: array_unshift() expects at least 2 parameters, 1 given in /in/H02Oa on line 8 Array ( [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 6 [6] => 7 [7] => 8 [8] => 9 [9] => 10 [10] => 11 [11] => 12 [12] => 13 [13] => 14 [14] => 15 [15] => 16 [16] => 17 [17] => 18 [18] => 19 [19] => 20 )
Output for hhvm-3.10.0 - 3.12.0
Warning: array_unshift() expects exactly 2 parameters, 1 given in /in/H02Oa on line 8 Array ( [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 6 [6] => 7 [7] => 8 [8] => 9 [9] => 10 [10] => 11 [11] => 12 [12] => 13 [13] => 14 [14] => 15 [15] => 16 [16] => 17 [17] => 18 [18] => 19 [19] => 20 )
Output for 5.0.0 - 5.2.17
Warning: Wrong parameter count for array_unshift() in /in/H02Oa on line 8 Array ( [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 6 [6] => 7 [7] => 8 [8] => 9 [9] => 10 [10] => 11 [11] => 12 [12] => 13 [13] => 14 [14] => 15 [15] => 16 [16] => 17 [17] => 18 [18] => 19 [19] => 20 )
Output for 4.3.0 - 4.4.9
Warning: Wrong parameter count for range() in /in/H02Oa on line 4 Warning: Wrong parameter count for array_unshift() in /in/H02Oa on line 8