3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class induk { protected $alas=10; protected $miring=8; public function setAlas() { return ($this->alas/2); } public function setMiring() { return ($this->miring/2) } } class anak { protected $tinggi= public function hitungTinggi() { } } class cucu { public $pesan private function hitungLuas() { } } $CP2 = new induk(); echo CP2->setAlas(); echo PHP_EOL; echo CP2->setMiring(); echo PHP_EOL ?>
Output for 7.0.28 - 7.3.0rc3
Parse error: syntax error, unexpected '}', expecting ';' in /in/AXqVO on line 14
Process exited with code 255.
Output for 5.6.38
Parse error: syntax error, unexpected '}' in /in/AXqVO on line 14
Process exited with code 255.