3v4l.org

run code in 300+ PHP versions simultaneously
<?php class PhpNw15Conference { public function listSpeakers() { return array('James Mallison', 'Some universally hated Ruby developer'); }} /** * Class Controller */ class Controller extends BaseController { /** * @return array */ public function __construct(PhpNw15Conference $conference) { $this->conference = $conference; } public function speakersAction() { $speakers = $this->conference->listSpeakers(); /** Pass to template or CLI runner **/ return $speakers; } } /** Controller Resolver **/ $controller = 'Controller'; // Retrieved from URL + YAML config $action = 'speakersAction'; // Retrieved from URL + Yaml config $params = array(); // Retrieved from GET / POST parameters $reflector = new \ReflectionClass('Controller'); foreach ($reflector->getConstructor()->getParameters() as $parameter) { $className = $parameter->getClass()->getName(); $parameter = new $className; } var_dump((new $controller($parameter))->$action($params));
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Class "BaseController" not found in /in/nmGfq:8 Stack trace: #0 {main} thrown in /in/nmGfq on line 8
Process exited with code 255.

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