3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Controller { public function index($otherObj) { echo "Calling Controller::index\n"; if (method_exists($this, 'hook_' . __FUNCTION__)) { $this->{'hook_' . __FUNCTION__}(); } if (method_exists($otherObj, 'hook_' . __FUNCTION__)) { $otherObj->{'hook_' . __FUNCTION__}(); } } public function hook_index() { echo "Calling Controller::hook_index\n"; } } class LocalController { public function hook_index() { echo "Calling LocalController::hook_index\n"; } } $localController = new LocalController(); $controller = new Controller(); $controller->index($localController);
Output for git.master, git.master_jit, rfc.property-hooks
Calling Controller::index Calling Controller::hook_index Calling LocalController::hook_index

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