-
Notifications
You must be signed in to change notification settings - Fork 7.9k
New in initializers (reduced version) #7153
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
Conversation
for years we get things in half |
case ZEND_AST_NEW: | ||
{ | ||
zend_class_entry *ce = zend_ast_fetch_class(ast->child[0], scope); | ||
if (!ce) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Would UNEXPECTED make sense for the return FAILURE
branches added in this PR? I see them in the above case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I think we have too much UNEXPECTED in places where it's unlikely to actually matter...
e11e76b
to
9d3ff89
Compare
…e-daubois) This PR was merged into the 5.4 branch. Discussion ---------- [Validator] Add support of nested attributes | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | Fix #38503 | License | MIT | Doc PR | symfony/symfony-docs#15541 Although the RFC (https://wiki.php.net/rfc/new_in_initializers) is in the voting phase (until 14 July), it is already well on its way to passing. Based on `@nikic`'s development (php/php-src#7153), this makes the development of support possible. It will obviously take a little while before this pull request is merged. If this pull request is OK for you, I'll get to work on writing the existing documentation for the attribute validation constraints.  Not sure about the Symfony version to target, as `AtLeastOneOf` has been introduced in 5.1. Although, I couldn't find attributes validation documentation for 4.4. Commits ------- 1449450 [Validator] Add support of nested attributes for composite constraints
…e-daubois) This PR was merged into the 5.4 branch. Discussion ---------- [Validator] Add support of nested attributes | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | Fix #38503 | License | MIT | Doc PR | symfony/symfony-docs#15541 Although the RFC (https://wiki.php.net/rfc/new_in_initializers) is in the voting phase (until 14 July), it is already well on its way to passing. Based on `@nikic`'s development (php/php-src#7153), this makes the development of support possible. It will obviously take a little while before this pull request is merged. If this pull request is OK for you, I'll get to work on writing the existing documentation for the attribute validation constraints.  Not sure about the Symfony version to target, as `AtLeastOneOf` has been introduced in 5.1. Although, I couldn't find attributes validation documentation for 4.4. Commits ------- 1449450e2f [Validator] Add support of nested attributes for composite constraints
…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.
This is #6746, but allowing
new
only in:It does not allow
new
in properties and class constants, as these have tricky evaluation order issues, for which no satisfactory resolution was reached.RFC: https://wiki.php.net/rfc/new_in_initializers