Hello,

I'm a bit confused on inheritance. In the following example of a
proxy, do I need to be aware of a parent's hook and handle it
specially?

class Loud
{
    public string $name {
        get {
            return strtoupper($this->name);
        }
    }
}

class LoudProxy extends Loud
{
   public string $name {
       get {
           // detected the parent has a hook? //
           $return = parent::$name::get();
           // do something with return //
           return $return;
       }
   }
}

what happens if the Loud class later removes its hook implementation
(ex: moves it to the set hook)? Will my proxy now cause an error?

Would simply calling $this->name call the parents hook?

Robert Landers
Software Engineer
Utrecht NL

Reply via email to