3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Abstract Surfer Class * * @package hangten */ abstract class Surfer { abstract protected function rideWave($amplitude); public function applyWax($waxType){ echo("Ahh, all waxed up with '".$waxType."'. Ready to go!"); } public function paddleOut(){ echo("Paddling...."); } public function screamShark(){ echo("SHARK!!"); } } /** * RookieSurfer Class * * This surfer is green and can barely surf. * @package hangten */ class RookieSurfer extends Surfer { protected function rideWave($amplitude = 1){ echo("Trying.. Trying.. to ride a ".$amplitude."ft. wave, whew!"); } } /** * ProSurfer Class * * This surfer is crazy skilled!! * @package hangten */ class ProSurfer extends Surfer { protected function rideWave($amplitude = 8){ echo("Riding a ".$amplitude."ft. wave backwards doing a backflip!"); } } $rookie = new RookieSurfer; $rookie->applyWax('candleWax') ->paddleout() ->rideWave(2);
Output for git.master, git.master_jit, rfc.property-hooks
Ahh, all waxed up with 'candleWax'. Ready to go! Fatal error: Uncaught Error: Call to a member function paddleout() on null in /in/gbKUd:54 Stack trace: #0 {main} thrown in /in/gbKUd on line 54
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:
42.09 ms | 401 KiB | 8 Q