php-src/Zend/tests/allow_dynamic_properties_on_trait.phpt
DanielEScherzer f9d01e46fe
#[AllowDynamicProperties] validation: improve error messages (#15734)
For traits and interfaces, include the name of the relevant trait (or
interface) in the error message, the same way it is included for readonly
classes.
2024-09-04 22:54:42 +02:00

12 lines
217 B
PHP

--TEST--
#[AllowDynamicProperties] cannot be applied to trait
--FILE--
<?php
#[AllowDynamicProperties]
trait Test {}
?>
--EXPECTF--
Fatal error: Cannot apply #[AllowDynamicProperties] to trait Test in %s on line %d