3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class Lol { abstract public static function run(); public static function onceLol() { if (static::$cache!==NULL) { return static::$cache; } static::$cache = static::run(); return static::$cache; } } class Lol1 extends Lol { protected static $cache = NULL; public static function run() { echo "Lol1\n"; return 'PHP is the best language in the shit'; } } class Lol2 extends Lol { protected static $cache = NULL; public static function run() { echo "Lol2\n"; return 'Just lol'; } } echo Lol1::onceLol(); // echoing 'PHP is the best language in the shit' from Lol1 echo "\n"; echo Lol2::onceLol(); // echoing 'PHP is the best language in the shit' from Lol1 echo "\n"; echo Lol1::onceLol(); // echoing 'PHP is the best language in the shit' from Lol1 echo "\n"; echo Lol2::onceLol(); // echoing 'PHP is the best language in the shit' from Lol1
Output for git.master, git.master_jit, rfc.property-hooks
Lol1 PHP is the best language in the shit Lol2 Just lol PHP is the best language in the shit Just lol

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:
76.25 ms | 405 KiB | 5 Q