2 ms·
It is only for classes not for objects (stdClass). You can mark a class with the attribute #[AllowDynamicProperties] to allow dynamic properties. You can also
by tored 4y ago
It is only for classes not for objects (stdClass). You can mark a class with the attribute #[AllowDynamicProperties] to allow dynamic properties.
You can also still implement the __get/__set methods on the class to have dynamic properties.
What this RFC does is to remove not declared dynamic properties.
https://wiki.php.net/rfc/deprecate_dynamic_properties https://wiki.php.net/rfc/deprecate_dynamic_properties