= array_fill(0, $N, 1); $dummy = my_push_back($dummy, 2); function my_push_back($arr, $n) { $size = count($arr); $arr[$size] = $n; return $arr; } ?> N 10^2 10^4 10^6 time(sec) PHP 7.1.23, MacBook Pro 13-inch, 2018, 2.3 GHz Intel Core i5 1.00 × 10−5 2.31 × 10−4 1.86 × 10−2