3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $bar; function __construct($bar) { $this->bar = $bar; } function __destruct() { echo __METHOD__,"\n"; unset($this->bar); } } class Bar { function __destruct() { echo __METHOD__,"\n"; unset($this->bar); } } class Baz { function __destruct() { echo __METHOD__,"\n"; unset($this->bar); } } $y = new Bar(); $y = new Baz(); echo 'a'; throw new Exception('Division by zero.'); echo 'b'; $x = new Foo($y); echo 'c'; ?>
Output for git.master, git.master_jit, rfc.property-hooks
Bar::__destruct a Fatal error: Uncaught Exception: Division by zero. in /in/HvnMg:30 Stack trace: #0 {main} thrown in /in/HvnMg on line 30 Baz::__destruct
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:
43.79 ms | 401 KiB | 8 Q