3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $users = array(35,25,45,34,56,67); $months = array('smelly','stinky','chubby','grubby','nubby','funky'); foreach($users as $user){ $mdata[$user] = array(); foreach($months as $month){ array_push($mdata[$user][],$month); } } print_r($mdata); ?>
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Warning: array_push() expects parameter 1 to be array, null given in /in/W3rkO on line 13 Array ( [35] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => ) [25] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => ) [45] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => ) [34] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => ) [56] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => ) [67] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => ) )
Output for hhvm-3.10.0 - 3.12.0
Warning: Invalid operand type was used: array_push expects array(s) or collection(s) in /in/W3rkO on line 13 Warning: Invalid operand type was used: array_push expects array(s) or collection(s) in /in/W3rkO on line 13 Warning: Invalid operand type was used: array_push expects array(s) or collection(s) in /in/W3rkO on line 13 Warning: Invalid operand type was used: array_push expects array(s) or collection(s) in /in/W3rkO on line 13 Warning: Invalid operand type was used: array_push expects array(s) or collection(s) in /in/W3rkO on line 13 Warning: Invalid operand type was used: array_push expects array(s) or collection(s) in /in/W3rkO on line 13 Warning: Invalid operand type was used: array_push expects array(s) or collection(s) in /in/W3rkO on line 13 Warning: Invalid operand type was used: array_push expects array(s) or collection(s) in /in/W3rkO on line 13 Warning: Invalid operand type was used: array_push expects array(s) or collection(s) in /in/W3rkO on line 13 Warning: Invalid operand type was used: array_push expects array(s) or collection(s) in /in/W3rkO on line 13 Warning: Invalid operand type was used: array_push expects array(s) or collection(s) in /in/W3rkO on line 13 Warning: Invalid operand type was used: array_push expects array(s) or collection(s) in /in/W3rkO on line 13 Warning: Invalid operand type was used: array_push expects array(s) or collection(s) in /in/W3rkO on line 13 Warning: Invalid operand type was used: array_push expects array(s) or collection(s) in /in/W3rkO on line 13 Warning: Invalid operand type was used: array_push expects array(s) or collection(s) in /in/W3rkO on line 13 Warning: Invalid operand type was used: array_push expects array(s) or collection(s) in /in/W3rkO on line 13 Array ( [35] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => ) [25] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => ) [45] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => ) [34] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => ) [56] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => ) [67] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => ) )
Output for 4.3.2 - 5.2.17
Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Warning: array_push(): First argument should be an array in /in/W3rkO on line 13 Array ( [35] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => ) [25] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => ) [45] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => ) [34] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => ) [56] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => ) [67] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => ) )
Output for 4.3.0 - 4.3.1
Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Warning: array_push() [http://www.php.net/function.array-push]: First argument should be an array in /in/W3rkO on line 13 Array ( [35] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => ) [25] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => ) [45] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => ) [34] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => ) [56] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => ) [67] => Array ( [0] => [1] => [2] => [3] => [4] => [5] => ) )