3v4l.org

run code in 300+ PHP versions simultaneously
<?php class CP2 { protected $alas; protected $miring; public function set($a,$b) { $this->alas = $a; $this->miring = $b; echo "Alas: ".$this->alas.'.'."Miring: ".$this->miring.'.'; } } class subCP2 extends CP2 { protected $tinggi; protected function tinggi() { $this->tinggi=(pow($this->miring,2)-pow($this->alas,2)); echo "Tinggi Segitiga: ".$this->tinggi; } public function runTinggi() { echo $this->tinggi(); } } $run = new CP2(); $run = new subCP2(); $run->set(2,6); $run->runTinggi(); ?>

preferences:
44.93 ms | 402 KiB | 5 Q