3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Lock { public function __construct() { echo "Locked\n"; } public function __destruct() { echo "Unlocked\n"; } } function do_while_locked(Lock $lock) { // The exception implicitly keeps the lock alive. $GLOBALS['x'] = new Exception(); echo "Doing something\n"; } function foo() { $lock = new Lock(); do_while_locked($lock); echo "Done\n"; } foo(); echo "After\n";
Output for git.master_jit, git.master
Locked Doing something Done After Unlocked

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