3v4l.org

run code in 300+ PHP versions simultaneously
<?php use Closure; class Shared { public function share(Closure $closure) { return function($container) use ($closure) { // We'll simply declare a static variable within the Closures and if it has // not been set we will execute the given Closures to resolve this value // and return it back to these consumers of the method as an instance static $object; if(is_null($object)) { $object = $closure($container); } return $object; }; } }
Output for git.master, git.master_jit, rfc.property-hooks
Warning: The use statement with non-compound name 'Closure' has no effect in /in/d3279 on line 3

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