|
Good question. I'd suggest you always use them; the docs do not specify that they are required, but they also do not specify them as optional in void argument constructors. Examples also show the use of them at all times. Hence it may be an unintended "feature" that will be removed in the future; 5.0 had some interesting "features" like being able to overwrite $this, static abstract methods, and several others. These have mostly been corrected by 5.2 and onwards.
I'm not sure why it lets you get away with this tbh. It could be an unintended feature they never bothered to resolve, or that it may be a requirement to not break backwards compatibility. I did find a remnant in the types section that show an example of using new without the parenthesis, but it appears to be an example in PHP4.x. So if that's the case (I didn't program OO in php 4.x, so I'm not all that familiar with the intricacies of it), than it would be for backwards compatibility.
|