Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -1559,6 +1559,18 @@ $instance = new class ($a) extends \Foo implements
};
```

If an anonymous class has attributes, they MUST be placed starting on the next line after the `new` keyword, indented
once, and otherwise follow the same rules as other attributes specified in section 12. The remaining anonymous class
declaration after the final attribute MUST start on a new line and keep the same indentation as the attributes:

```php
$example = new
#[Attribute]
class {
...
};
```

## 9. Enumerations

Enumerations (enums) MUST follow the same guidelines as classes, except where otherwise noted below.
Expand Down