If you use array_push()
to add one element to an array it's better to use $array[] =
because in that way there is no overhead of calling the function.
<?php
array_push($array, 1); // ArrayPushShorthand: Since `array_push()` has the function call overhead, Consider using `$array[] =`.
<?php
$array[] = 1; // OK!