3v4l.org

run code in 200+ PHP versions simultaneously
<?php class Foo { private $bar; public static function make() { $foo = new static; $foo->bar = 'Hello World!'; return $foo; } public function getBar() { return $this->bar; } } var_dump(Foo::make()->getBar());
based on nDDLU

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for branch php-master
string(12) "Hello World!"
Output for branch php-master+opcache
string(12) "Hello World!"
Output for branch php-master+jit
string(12) "Hello World!"
Output for Typed properties v2
string(12) "Hello World!"
Output for Arrow functions
string(12) "Hello World!"
Output for Object typehint
string(12) "Hello World!"
Output for Array change keys
string(12) "Hello World!"
Output for Lexical anon
string(12) "Hello World!"

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