Self As Attribute

no-email (Jan Nedbal), Jan Nedbal
Sun, 01 Sep 2024 00:00:00 +0000

Self, parent and static cannot be used as attributes. They are not recognized, and PHP will search for a class called ``\self`` instead, in vain.
On the other hand, it is possible to use an attribute onto its own methods, simply by using its regular name.
It is possible to use these names as attributes, as long as they are not instanciated.
It is also possible to use aliases with the attributes: they will automatically resolve to the original class, not the aliased name.