3v4l.org

run code in 300+ PHP versions simultaneously
<?php class UberException extends Exception { public function __construct() { $refTrace = new ReflectionProperty('Exception', 'trace'); $refTrace->setAccessible(true); $refTrace->setValue($this, array(array('file' => 'data.php', 'line' => 20, 'function' => 'super', 'args' => array()))); $this->file = 'test.php'; $this->line = 5; } } function test() { throw new UberException(); } try { test(); } catch (Exception $e) { var_dump($e->getTrace()); throw $e; }

preferences:
35.34 ms | 402 KiB | 5 Q