8000 :sparkles: PHP 8.1: New `PHPCompatibility.InitialValue.NewNewInInitializers` sniff by jrfnl · Pull Request #1464 · PHPCompatibility/PHPCompatibility · GitHub
[go: up one dir, main page]

Skip to content

✨ PHP 8.1: New PHPCompatibility.InitialValue.NewNewInInitializers sniff #1464

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 8, 2023

Conversation

jrfnl
Copy link
Member
@jrfnl jrfnl commented Jan 3, 2023

new in Initializers

It is now possible to use new ClassName() expressions as the default value of a parameter, static variable, global constant initializers, and as attribute arguments.

Refs:

Includes unit tests.

Related to #1299

8000
…niff

> `new` in Initializers
>
> It is now possible to use `new ClassName()` expressions as the default value of a parameter, static variable, global constant initializers, and as attribute arguments.

Refs:
* https://wiki.php.net/rfc/new_in_initializers
* https://www.php.net/manual/en/migration81.new-features.php#migration81.new-features.core.new-in-initializer
* php/php-src#7153
* php/php-src@52d3d0d

Includes unit tests.
@wimg wimg merged commit 94e73ef into develop Jan 8, 2023
@wimg wimg deleted the php-8.1/new-newininitializers-sniff-2 branch January 8, 2023 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0