3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface ConfiguratorDelegate { public function didSelectOption($option); } class ViewController implements ConfiguratorDelegate { public function didSelectOption($option) { echo "Selected option"; } public function __construct() { $configurator = new Configurator(); $configurator->delegate = $this; // This is not how it works, this just shows the chain $configurator->delegate->optionSelected('derp'); } } class Configurator { public $delegate; // This would be defined as an object that always implements ConfiguratorDelegate private function optionSelected($option) { if ($delegate) { $delegate->didSelectOption($option); } } } $myVC = new ViewController();
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined method ViewController::optionSelected() in /in/Rf9TK:19 Stack trace: #0 /in/Rf9TK(34): ViewController->__construct() #1 {main} thrown in /in/Rf9TK on line 19
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:
41.85 ms | 401 KiB | 8 Q