<?phperror_reporting(-1); $a = array_fill(0,6,0); //что бы в дальнейшем можно было использовать foreach var_dump ($a); foreach ($a as $element) { $element = mt_rand(0,9);} var_dump ($a);
Standard input is empty
array(6) { [0]=> int(0) [1]=> int(0) [2]=> int(0) [3]=> int(0) [4]=> int(0) [5]=> int(0) } array(6) { [0]=> int(0) [1]=> int(0) [2]=> int(0) [3]=> int(0) [4]=> int(0) [5]=> int(0) }
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!