fork(8) download
  1. <?php
  2. class Pai {
  3. protected $protegido = 'Protegido';
  4. protected function metodoProtegido() {
  5. echo 'Método protegido na classe pai';
  6. }
  7. }
  8.  
  9. class Filha extends Pai {
  10. public function acessarAtributoProtegido(){
  11. echo $this->protegido;
  12. }
  13. public function chamarMetodoProtegido() {
  14. parent::metodoProtegido();
  15. }
  16. }
  17.  
  18.  
  19.  
Success #stdin #stdout 0s 82880KB
stdin
Standard input is empty
stdout
Standard output is empty