3v4l.org

run code in 300+ PHP versions simultaneously
<?php class segitiga { protected $alas; protected $tinggi; public function setalas ($a) { $pr=$this->$alas; $pr=10; return $pr; } public function settinggi ($a) { $tgg=$this->$tinggi; $tgg=15; return $tgg; } } class hitmir extends segitiga { protected $miring; private function hit($a) { $mir=($pr*$pr+$tgg*$tgg); } } $ob= new segitiga(); $ob2= new hitmir(); echo PHP_EOL; $ob2->this->hit();
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined property: hitmir::$this in /in/pg15B on line 31 Fatal error: Uncaught Error: Call to a member function hit() on null in /in/pg15B:31 Stack trace: #0 {main} thrown in /in/pg15B on line 31
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:
55.17 ms | 401 KiB | 8 Q