3v4l.org

run code in 300+ PHP versions simultaneously
<?php $methods = [ 'hello' => function(string $name) { echo sprintf('Hello %s!%s', $name, PHP_EOL); }, 'goodbye' => function(string $name) { echo sprintf('Goodbye %s!%s', $name, PHP_EOL); }, ]; /** * @method Talk hello(string $name) * @method Talk goodbye(string $name) */ class Talk { private $methods = []; public function __construct(array $methods) { $this->methods = $methods; } public function __call(string $method, array $arguments) { if ($func = $this->methods[$method] ?? false) { $func(...$arguments); return $this; } throw new \RuntimeException(sprintf('Missing %s method.')); } } $howdy = new Talk($methods); $howdy->hello('Jim')->goodbye('Joe');
Output for git.master, git.master_jit, rfc.property-hooks
Hello Jim! Goodbye Joe!

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