3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class induk { protected function alas() { return "miring"; } } class anak extends induk { protected function tinggi() { return "hitung tinggi"; } } class cucu extends anak { protected function public() { return "hitun tinggi"; } public function hitung(){ $a = $this->set tinggi(); $b = $this->hitung tinggi(); $c = $this->hitung luas(); return "$a <br /> $b <br /> $c"; } } $gadget_baru = new induk(); echo $gadget_baru->hitung() ?>
Output for 7.0.28 - 7.3.0rc3
Parse error: syntax error, unexpected 'tinggi' (T_STRING) in /in/9fFSd on line 20
Process exited with code 255.
Output for 5.6.38
Parse error: syntax error, unexpected 'public' (T_PUBLIC), expecting identifier (T_STRING) in /in/9fFSd on line 15
Process exited with code 255.