PHP 8.4 introduces a feature allowing developers to create new objects without parentheses, simplifying code and enabling method chaining directly on newly created objects. This update extends to methods, properties, static methods, and even supports dynamic and anonymous classes. However, constructor brackets remain mandatory for class instantiation to avoid parsing ambiguities. Despite minor limitations, this syntactic sugar promises to enhance coding efficiency.
Table of contents
# Methods, properties, and more# Also for dynamic and anonymous classes# Constructor brackets are required# Anonymous classes are the exceptionFootnotes7 Comments
Sort: