3v4l.org

run code in 300+ PHP versions simultaneously
<?php class PhpNw15Conference { public function listSpeakers() { return array('James Mallison', 'Some other speaker'); } } /** * Class Controller */ class Controller { /** * @return array */ public function __construct(PhpNw15Conference $conference) { $this->conference = $conference; } public function speakersAction() { return $this->conference->listSpeakers(); } } /** 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->getName(); $parameter = new $className; } echo (new $controller($parameter))->$action($params);
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Class "conference" not found in /in/1Y4Qu:40 Stack trace: #0 {main} thrown in /in/1Y4Qu on line 40
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:
40.49 ms | 401 KiB | 8 Q