3v4l.org

run code in 300+ PHP versions simultaneously
<?php class induk{ protected $tinggi=6; protected $alas=20; public function SetTinggi(){ return ($this->tinggi/2); } public function setAlas(){ return ($this->alas/2) } } $cp2 =new induk(); echo $cp2 ->SetTinggi echo $cp2 ->aetAlas
Output for 7.1.0 - 7.1.23, 7.2.0 - 7.2.11
Parse error: syntax error, unexpected '}', expecting ';' in /in/d5nSo on line 12
Process exited with code 255.
Output for 5.6.38
Parse error: syntax error, unexpected '}' in /in/d5nSo on line 12
Process exited with code 255.

preferences:
175.64 ms | 1386 KiB | 44 Q