If you simply want to assign values to a variable this way:
$array[]="value 1" and $array[]="value 2"
do you first have to declare $array=array()? Obviously you don’t HAVE to, as it works without it, but why would you do that then? Or what is the benefit of doing it?
What you are describing is not a declaration but an initialization. You are not declaring $array is an array, you are assigning it a value (empty array).
Such an initialization can be used to establish a scope, and perhaps it can make the code more readable (although I can’t see how), but usually it is only done when you specifically want an empty array. The classic example is when using the [] syntax to append to an array. Consider the following:
Without the second line, this will produce an error.
By the way, The array() command isn’t an ordinary function. It’s a language construct, and starting with PHP 5.4 you can replace it with the shorter [] syntax: