I know, in PHP, we can create an object using new ClassName
and also using new ClassName()
(notice the parenthesis). Is there ANY difference between both of these ways at all?
Nope, no difference whatsoever. If you don't need to pass parameters to the constructor, the parentheses are entirely superfluous.
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