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!"); } public function killSharkWithBoard(){ echo("totally just sliced that shark in two!! booya!"); } } $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!Paddling.... Fatal error: Uncaught Error: Call to protected method RookieSurfer::rideWave() from global scope in /in/61tp7:59 Stack trace: #0 {main} thrown in /in/61tp7 on line 59
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:
40.85 ms | 401 KiB | 8 Q