3v4l.org

run code in 300+ PHP versions simultaneously
<?php class render { /** @var array */ private static $extensions; public static function __callStatic($function, $args) { // check if method exists if ( method_exists( __CLASS__, $function )) { self::{$function}(self::$args); } elseif (isset(self::$extensions[$function])) { (self::$extensions[$function])($args); } } public static function title($args) { echo 'Calling title()', PHP_EOL; } public static function register(string $name, callable $callback) { self::$extensions[$name] = $callback; } } render::register('custom', function(...$args) { echo 'Calling custom function', PHP_EOL; var_dump($args); }); render::title(1, 2, 3, 4); render::custom(1, 2, 3, 4);
Output for git.master, git.master_jit, rfc.property-hooks
Calling title() Calling custom function array(1) { [0]=> array(4) { [0]=> int(1) [1]=> int(2) [2]=> int(3) [3]=> int(4) } }

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