<?php
class Pai {
protected $protegido = 'Protegido';
protected function metodoProtegido() {
echo 'Método protegido na classe pai';
}
}
class Filha extends Pai {
public function acessarAtributoProtegido(){
echo $this->protegido;
}
public function chamarMetodoProtegido() {
parent::metodoProtegido();
}
}
PD9waHAKIGNsYXNzIFBhaSB7CiAgICBwcm90ZWN0ZWQgICRwcm90ZWdpZG8gPSAnUHJvdGVnaWRvJzsKICAgIHByb3RlY3RlZCBmdW5jdGlvbiBtZXRvZG9Qcm90ZWdpZG8oKSB7CiAJICAJZWNobyAnTcOpdG9kbyBwcm90ZWdpZG8gbmEgY2xhc3NlIHBhaSc7Cgl9CiB9CgogY2xhc3MgRmlsaGEgZXh0ZW5kcyBQYWkgewogICAgcHVibGljIGZ1bmN0aW9uIGFjZXNzYXJBdHJpYnV0b1Byb3RlZ2lkbygpewogICAgICAgCWVjaG8gJHRoaXMtPnByb3RlZ2lkbzsKICAgIH0KICAgIHB1YmxpYyBmdW5jdGlvbiBjaGFtYXJNZXRvZG9Qcm90ZWdpZG8oKSB7CiAgICAgICAJcGFyZW50OjptZXRvZG9Qcm90ZWdpZG8oKTsKICAgIH0KIH0KIAogCiA=