Other objects in PHP are instantiated using the new qualifier such as new Date(), etc. How come you do not supply the new qualfier with Array() when instantiating a new array in PHP?
$array = new Array(); //blows up
$array = Array(); //works as intended
$reflect = new ReflectionClass($this); //works as intended
$reflect = ReflectionClass($this); //blows up
Array is a language construct not a class so you cant use new to instantiate an Array object.
Because array is syntax, not a class. Same as with list, echo, and a few others.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With