3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class CSqlException extends Exception { public function __construct($p_Message, $p_Code=0) { parent::__construct($p_Message, $p_Code, null); } } try { throw new CsqlException('foo', "abc"); } catch (Exception $e) { echo $e->getMessage(); }

Shows result from various feature-branches currently under review from the php developers. Contact me to have additional branches featured.

Output for Typed properties v2
Fatal error: Uncaught Error: Wrong parameters for CSqlException([string $message [, long $code [, Throwable $previous = NULL]]]) in /in/0gviC:8 Stack trace: #0 /in/0gviC(8): Exception->__construct('foo', 'abc', NULL) #1 /in/0gviC(13): CSqlException->__construct('foo', 'abc') #2 {main} thrown in /in/0gviC on line 8
Output for Array change keys
Fatal error: Uncaught Error: Wrong parameters for CSqlException([string $message [, long $code [, Throwable $previous = NULL]]]) in /in/0gviC:8 Stack trace: #0 /in/0gviC(8): Exception->__construct('foo', 'abc', NULL) #1 /in/0gviC(13): CSqlException->__construct('foo', 'abc') #2 {main} thrown in /in/0gviC on line 8
Output for Lexical anon
Fatal error: Wrong parameters for Exception([string $exception [, long $code [, Exception $previous = NULL]]]) in /in/0gviC on line 8

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