3v4l.org

run code in 300+ PHP versions simultaneously
<?php class X { public $hi; public function hi($hi) { $this->hi = $hi; } } class A { protected function foo($name, Closure $t) { $x = new X(); echo $name; echo "\n"; $t($x); print_r($x); } } class B extends A { public function __construct() { $this->foo('users', function($t) { $t->hi('hello!'); }); } } new B();
Output for git.master, git.master_jit, rfc.property-hooks
users X Object ( [hi] => hello! )

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:
39.96 ms | 401 KiB | 8 Q