On Sat, Aug 2, 2025, at 22:33, Rowan Tommins [IMSoP] wrote: > On 2 August 2025 20:12:59 BST, Rob Landers <rob@bottled.codes> wrote: > >I mentioned in my first reply, there is no way to get an instance-level > >property unshadowed. It is there though (according to inheritance.c, if I’m > >reading it right, it is still accessible, just not from user-land). > > > I'd be interested to see what code you're looking at. As I showed in my last > email, there's an explicit difference in how private and protected property > names are mangled, and it's consistent with how reflection, serialisation, > and debug functions output them - which is that there is only one property, > no matter how many times in the inheritance chain it is redefined. > > > Rowan Tommins > [IMSoP] >
If this were the case, then creating a base class with default values wouldn’t be possible. The memory exists and is set aside for that. The child class shadows this value, but the original value still exists. You can get to it by calling into the parent class entry and accessing it that way. There is no way to get to that value from an instance in php, though — from the perspective of the child, shadowing loses the original default value. — Rob