-
Notifications
You must be signed in to change notification settings - Fork 860
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Affected page
https://www.php.net/manual/en/class.allowdynamicproperties.php
Current issue
The current example does not explain what happens, when you inherit from a class, defining #[\AllowDynamicProperties] attribute.
Suggested improvement
Therefore i'd suggest to use the following, extended example:
<?php
class DefaultBehaviour { }
#[\AllowDynamicProperties]
class ClassAllowsDynamicProperties { }
class InheritedClassAllowsDynamicProperties extends ClassAllowsDynamicProperties { }
$o1 = new DefaultBehaviour();
$o2 = new ClassAllowsDynamicProperties();
$o3 = new InheritedClassAllowsDynamicProperties();
$o1->nonExistingProp = true;
$o2->nonExistingProp = true;
$o3->nonExistingProp = true;
?>The output is still identical to the current version.
Additional context (optional)
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request