-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
PHP 8.1 new
in initializers support
#104
Comments
new
in initializers suppoynew
in initializers support
This one should be implemented as a new flag as well? |
Difficult to say: I think this is part of The bulk of all logic lives in the
It may perhaps be something relevant post-release, but the isomorphism between |
Will give it a try on wednesday @lyska or after my other two open patches ✌️ |
As discussed with @michaelpetri, the problem with The For example: class MyDefaultValue {
public int $value;
public function __construct() {
$this->value = random_int(1, 10000);
}
}
$value = new MyDefaultGenerator();
// this is potentially wrong: `'new MyDefaultValue()'` is probably not reliable either?
$parameterGenerator->setDefaultValue(ValueGenerator::fromObject($value)); I don't think it is realistically feasible to solve this problem by |
This might be doable by casting reflectors to string since php/php-src#7540 |
https://wiki.php.net/rfc/new_in_initializers
The text was updated successfully, but these errors were encountered: