3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class segitihga { protected $alas; protected $tinggi; protected static $a; { return $this->L=$lebar; $this->T=$tinggi; echo $v = $panjang*$lebar*$tinggi; } public function cetak() { echo $this->v=$volume; } public function cetak_pesan($print) { echo $this->pesan=$pesan; } } class luas extends segi { private $t; } class keliling extends luas { } $hitung = new segi(); echo $this->t=12; echo $this->l=10; echo $this->t=8; echo $this->v=P*L*T; echo PHP_EOL;
based on uETCt
Output for 7.1.0 - 7.3.0rc3
Parse error: syntax error, unexpected '{', expecting function (T_FUNCTION) or const (T_CONST) in /in/GZ9Vu on line 8
Process exited with code 255.
Output for 5.6.38 - 7.0.28
Parse error: syntax error, unexpected '{', expecting function (T_FUNCTION) in /in/GZ9Vu on line 8
Process exited with code 255.