3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { private $m_bThrow = FALSE; public function __construct($bThrow) { $this->m_bThrow = $bThrow; } public function __destruct() { if ($this->m_bThrow) { throw new Exception('Exception in destructor!'); } } } function abc2() { $a = new A(TRUE); throw new Exception('manual exception'); } try { abc2(); echo 'Unexpected no exception!' . "\n"; } catch (Exception $e) { echo $e->getMessage() . "\n"; } ?>
Output for git.master, git.master_jit, rfc.property-hooks
Exception in destructor!

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