Instantiate a class with or without parentheses? [duplicate]

Any difference in performance is going to be absolutely negligible.

While both ways are fine, I personally would prefer using new Car(); because usually, a method is being called here, and function/method calls in PHP require (). Also, it’s more consistent with instantiations that have parameters.

But in the end, it’s down to taste. It doesn’t matter which way you choose, but when you choose one, stick to it consistently!

Leave a Comment