3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Example { public function sayHi () { echo "hi"; } } class Caller { private $_controller, $_action; public function __construct ($cont, $action) { $this->_controller = $cont; $this->_action = $action; } public function __toString() { return (string)$this->_action; } public function run () { $controller = new $this->_controller; if (is_callable(array($controller, $this->_action))) { $controller->$this->_action(); } } } $caller = new Caller ('Example', 'sayHi'); $caller->run();
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined property: Example::$sayHi in /in/JYo0T on line 24 Fatal error: Uncaught Error: Call to a member function _action() on null in /in/JYo0T:24 Stack trace: #0 /in/JYo0T(30): Caller->run() #1 {main} thrown in /in/JYo0T on line 24
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:
66.86 ms | 401 KiB | 8 Q