3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class induk{ protected $alas; protected $tinggi; public function set($a,$t){ $this->alas = $a; $this->tinggi = $t; echo "alas: ".$a."<br />"."Tinggi: ".$t; } } class anak extends induk{ protected $miring; protected function hitungSisi($a,$t){ $miring = (1/2)*$a*$t; echo "Sisi miring: ".$miring; } } class cucu extends anak { public $pesan; private function keliling($a,$t,$c) { $this->miring = $c; $keliling = $c + $a + $t } } $segi = new induk(); $segi = new anak(); $segi = new cucu(); $segi->set(2,7); echo PHP_EOL; $segi->hitungSisi(); echo PHP_EOL; $segi->keliling(); ?>
Output for 5.6.38 - 7.3.0rc3
Parse error: syntax error, unexpected '}' in /in/5eA7N on line 30
Process exited with code 255.