3v4l.org

run code in 300+ PHP versions simultaneously
<?php $ran = 0; class Foo { public function __destruct() { global $ran; $ran++; } } function bar(Foo $foo) { global $ran; echo "Bar $ran\n"; unset($foo); echo "Unset(bar) $ran\n"; } echo "Start $ran\n"; $f = new Foo(); echo "New $ran\n"; bar($f); echo "Bar(f) $ran\n"; unset($f); echo "unset(f) $ran\n"; bar(new Foo); echo "Bar(f) $ran\n";
Output for git.master, git.master_jit, rfc.property-hooks
Start 0 New 0 Bar 0 Unset(bar) 0 Bar(f) 0 unset(f) 1 Bar 1 Unset(bar) 2 Bar(f) 2

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:
48.47 ms | 401 KiB | 8 Q