i am not shure about this, but aren't the function implemented ( is that an english word? well, anyway... ) at the same level as the operators?
No, they are not. In PHP, operators are language constructs, not functions.
By this i mean, despite the diferent looking in the code, what apears to be so much simpler might be the exact same or sometimes even worse in terms of eficiency.
That is possible, but we are dealing with small efficiencies here so it doesnt really matter either way. In this case, the PHP Manual recommends not using array_push() when only one element is to be pushed to the end of the array. Read the PHP Manual on [man]array_push/man.
about the first pushed value... we could use a if(isset $foo) test well... now that would slow down the thing s it has to be tested all the time...
If $array does not exist, this code creates an array $array with $array[0] set to the value of $value.
$array[] = $value;
This code pushes the value of $value to the end of the $array, which should exist prior to the function call:
array_push($array, $value);
This means that you must declare $array before you use array_push(), whereas this isnt required for the $array[] = $value; syntax.
However, in the code that we are concerned with, if $results is not declared prior to the loop, then it will not even be created if the loop does not even run one iteration. If so, return $results; would be incorrect since $results would not exist, hence declaring $results before the loop is correct.