3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ApiException extends \Exception { public function __construct(string $message, int $code = 0, \Exception $previous = null) { parent::__construct($message, $code, $previous); } public function __toString() { return $this->getTraceAsString().': '.$this->message; } } function foo() { bar(); } function bar() { throw new ApiException('Please select a date between 1950 and 2050'); } try { foo(); } catch (Exception $e) { echo $e; }
Output for git.master, git.master_jit, rfc.property-hooks
#0 /in/UHI08(18): bar() #1 /in/UHI08(26): foo() #2 {main}: Please select a date between 1950 and 2050

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.92 ms | 401 KiB | 8 Q