3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * @author Lisachenko Alexander <https://twitter.com/lisachenko> */ class ChuckNorrisException extends Exception { public function __construct($message, array $trace = array(), $code = 0, Exception $previous = null) { parent::__construct($message, 0, $previous); $this->file = 'Real Life'; $setter = function(array $newTrace = array()) { /** @var $this Exception */ $this->trace = $newTrace; var_dump($this); }; $setter->bindTo($this, 'Exception')->__invoke($trace); } } throw new ChuckNorrisException("Hello", array( array('file' => 'Chuck Norris, level', 'line' => 99, 'class' => 'own you ', 'function' => 'with uppercut!') ));
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Cannot bind closure to scope of internal class Exception in /in/WnjAb on line 16 Fatal error: Uncaught Error: Call to a member function __invoke() on null in /in/WnjAb:16 Stack trace: #0 /in/WnjAb(20): ChuckNorrisException->__construct('Hello', Array) #1 {main} thrown in /in/WnjAb on line 16
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:
52.24 ms | 401 KiB | 8 Q