Description
Referenced RFC #13455
The following code:
<?phpfinalreadonlyclass ReadonlyClassWithProperty
{
publicconstintDEFAULT_VALUE = 640;
publicfunction__construct(
publicint$value = self::DEFAULT_VALUE {
set(int$value) => $value;
},
) {}
}
// Need to create new object multiple times$ctx = newReadonlyClassWithProperty();
$ctx = newReadonlyClassWithProperty();Resulted in this output:
But I expected this output instead:
PHP Fatal error: Uncaught Error: Cannot modify readonly property ReadonlyClassWithProperty::$value in ...
Stack trace:
#0 ...: ReadonlyClassWithProperty->$value::set(640)
#1 ...: ReadonlyClassWithProperty->__construct()
#2 {main}
thrown in ...
@iluuu1994 I mention you again, this time it's a not known issue, right?)
PHP Version
PHP 8.4-beta1
Operating System
No response
Description
Referenced RFC #13455
The following code:
Resulted in this output:
But I expected this output instead:
@iluuu1994 I mention you again, this time it's a not known issue, right?)
PHP Version
PHP 8.4-beta1
Operating System
No response