3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace vendor\package\exception { class Ex1 extends \Exception {} } namespace vendor\package { use vendor\package\exception\Ex1; try { throw new Ex1('Exception 1'); } catch (Ex1 $e) { echo "Catched: ".$e->getMessage()."\n"; }; } namespace vendor\package { use vendor\package\exception as ex; try { throw new ex\Ex1('Exception 2'); } catch (ex\Ex1 $e) { echo "Catched: ".$e->getMessage()."\n"; }; } namespace vendor\package { use vendor\package\exception as ex; try { throw new ex\Ex1('Exception 3'); } catch (\Exception $e) { echo "Catched: ".$e->getMessage()."\n"; }; } namespace vendor\package { use vendor\package\exception as ex; try { throw new ex\Ex1('Exception 4'); } catch (\Throwable $e) { echo "Catched: ".$e->getMessage()."\n"; }; }
Output for git.master, git.master_jit, rfc.property-hooks
Catched: Exception 1 Catched: Exception 2 Catched: Exception 3 Catched: Exception 4

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