mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
16 lines
397 B
Plaintext
16 lines
397 B
Plaintext
|
--TEST--
|
||
|
GH-10377 (Unable to have an anonymous readonly class) - usage variation: dynamic properties attribute
|
||
|
--FILE--
|
||
|
<?php
|
||
|
|
||
|
$readonly_anon = new #[AllowDynamicProperties] readonly class {
|
||
|
public int $field;
|
||
|
function __construct() {
|
||
|
$this->field = 2;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
?>
|
||
|
--EXPECTF--
|
||
|
Fatal error: Cannot apply #[AllowDynamicProperties] to readonly class class@anonymous in %s on line %d
|