3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Kubus { public function set_sisi($s); public function luas_kubus(); public function volume_kubus(); } interface Balok { public function luas_balok($p, $l); public function volume_balok($t); } class Hitung implements Kubus, Balok{ public $sisi; public function set_sisi($s) { $this->sisi = $s; return $this; } public function luas_kubus() { echo "Luas Kubus = " . $this->sisi * 2; return $this; } public function volume_kubus() { echo "Volume Kubus = " . $this->sisi * 3; return $this; } public function luas_balok($p, $l) { return; } public function volume_balok($t) { return; } } $hitung = new Hitung; echo $hitung->set_sisi(4)->luas_kubus()->volume_kubus();
Output for git.master, git.master_jit, rfc.property-hooks
Luas Kubus = 8Volume Kubus = 12 Fatal error: Uncaught Error: Object of class Hitung could not be converted to string in /in/L1Qbb:38 Stack trace: #0 {main} thrown in /in/L1Qbb on line 38
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
34.1 ms | 401 KiB | 8 Q