1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 19:23:22 +02:00
Files
archived-php-src/Zend/tests/allow_dynamic_properties_on_interface.phpt
T
Nikita Popov 902d64390e Deprecate implicit dynamic properties
Writing to a proprety that hasn't been declared is deprecated,
unless the class uses the #[AllowDynamicProperties] attribute or
defines __get()/__set().

RFC: https://wiki.php.net/rfc/deprecate_dynamic_properties
2021-11-26 14:10:11 +01:00

12 lines
224 B
PHP

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