3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyException extends Exception { public function __construct($message, $code=0) { if (version_compare(PHP_VERSION, '5.3.0') >= 0) { $previous = func_get_arg(2); parent::__construct($message,$code,$previous); } else { parent::__construct($message,$code); } } public function __toString() { return __CLASS__. ":[{$this->code}]:{$this->message}\n"; } } throw new MyException("Foo");
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function in /in/XQHo4:8 Stack trace: #0 /in/XQHo4(8): func_get_arg(2) #1 /in/XQHo4(20): MyException->__construct('Foo') #2 {main} thrown in /in/XQHo4 on line 8
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:
39.79 ms | 401 KiB | 8 Q