3v4l.org

run code in 300+ PHP versions simultaneously
<?php function dump(...$values): void { foreach ($values as $value) { echo json_encode($value, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES), PHP_EOL; } } class Foo { public readonly Exception $e; public function __construct() { $this->e = new Exception; dump(debug_backtrace()); } } class Bar extends Foo { public function __construct() { parent::__construct(); } } function Bar(): Bar { return new Bar(); } $bar = new Bar(); dump($bar->e->getTrace());
Output for git.master, git.master_jit
[ { "file": "/in/QjBWV", "line": 24, "function": "__construct", "class": "Foo", "object": { "e": {} }, "type": "->", "args": [] }, { "file": "/in/QjBWV", "line": 33, "function": "__construct", "class": "Bar", "object": { "e": {} }, "type": "->", "args": [] } ] [ { "file": "/in/QjBWV", "line": 24, "function": "__construct", "class": "Foo", "type": "->", "args": [] }, { "file": "/in/QjBWV", "line": 33, "function": "__construct", "class": "Bar", "type": "->", "args": [] } ]

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:
55.12 ms | 407 KiB | 5 Q