3v4l.org

run code in 300+ PHP versions simultaneously
<?php $m = 3; $n = 4; $x = array_map( function () use ($m) { return array_fill(0, $m, 0); }, range(1, $n) ); print_r($x);
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.30, 8.0.0 - 8.0.20, 8.1.0 - 8.1.7
Array ( [0] => Array ( [0] => 0 [1] => 0 [2] => 0 ) [1] => Array ( [0] => 0 [1] => 0 [2] => 0 ) [2] => Array ( [0] => 0 [1] => 0 [2] => 0 ) [3] => Array ( [0] => 0 [1] => 0 [2] => 0 ) )

preferences:
47.48 ms | 411 KiB | 5 Q