3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface RequestInterface{} class Request implements RequestInterface {} interface Promise{} class PromiseImpl implements Promise {} interface Plugin { public function handleRequest(RequestInterface $request, callable $next, callable $first); } abstract class ForwardCompatibilityPlugin implements Plugin { abstract function doHandleRequest(RequestInterface $request, callable $next, callable $first); public function handleRequest(RequestInterface $request, callable $next, callable $first) { return $this->doHandleRequest($request, $next, $first); } } class MyPlugin extends ForwardCompatibilityPlugin { /** * {@inheritdoc} */ public function doHandleRequest(RequestInterface $request, callable $next, callable $first) { echo "foobar\n"; return $next($request); } } $request = new Request(); $callable = function() { echo "callable\n"; return new PromiseImpl(); }; $plugin = new MyPlugin(); $plugin->handleRequest($request, $callable, $callable);
Output for git.master, git.master_jit, rfc.property-hooks
foobar callable

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