3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Abstract Surfer Class * * @package hangten */ abstract class Surfer { abstract public function rideWave($amplitude); public function applyWax($waxType){ echo("Ahh, all waxed up with '".$waxType."', ready to go!<br />"); } public function paddleOut(){ echo("Paddling....<br />"); } public function screamShark(){ echo("SHARK!!<br />"); } } /** * RookieSurfer Class * * This surfer is green and can barely surf. * @package hangten */ class RookieSurfer extends Surfer { public function rideWave($amplitude = 1){ echo("Trying.. Trying.. to ride a ".$amplitude."ft. wave, whew!<br />"); } } /** * ProSurfer Class * * This surfer is crazy skilled!! * @package hangten */ class ProSurfer extends Surfer { public function rideWave($amplitude = 8){ echo("Riding a ".$amplitude."ft. wave backwards doing a backflip!<br />"); } public function killSharkWithBoard(){ echo("totally just sliced that shark in two!! booya!<br />"); } } $rookie = new RookieSurfer; $rookie->applyWax("Candle Wax"); $rookie->paddleOut(); $rookie->rideWave(2); $rookie->screamShark(); $pro = new ProSurfer; $pro->applyWax("Sex Wax"); $pro->paddleOut(); $pro->rideWave(50); $pro->killSharkWithBoard();
Output for git.master, git.master_jit, rfc.property-hooks
Ahh, all waxed up with 'Candle Wax', ready to go!<br />Paddling....<br />Trying.. Trying.. to ride a 2ft. wave, whew!<br />SHARK!!<br />Ahh, all waxed up with 'Sex Wax', ready to go!<br />Paddling....<br />Riding a 50ft. wave backwards doing a backflip!<br />totally just sliced that shark in two!! booya!<br />

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:
40.69 ms | 401 KiB | 8 Q