3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (!defined('PHP_INT_MAX')) { $min = -1; do { $last = $min; } while(0 > $min <<= 1); define('PHP_INT_MIN', $last); define('PHP_INT_MAX', ~$last); } class Foo { function getBacktrace($firstLevel = 0, $count = PHP_INT_MAX) { $result = array(); foreach (array_slice(debug_backtrace(false), 1 + $firstLevel) as $level) { var_dump($level); } } function bar() { $this->getBacktrace(); } function baz() { Foo::getBacktrace(); } } $a = new Foo; $a->bar(); Foo::baz();
Output for git.master, git.master_jit, rfc.property-hooks
array(6) { ["file"]=> string(9) "/in/r82We" ["line"]=> int(32) ["function"]=> string(3) "bar" ["class"]=> string(3) "Foo" ["type"]=> string(2) "->" ["args"]=> array(0) { } } Fatal error: Uncaught Error: Non-static method Foo::baz() cannot be called statically in /in/r82We:33 Stack trace: #0 {main} thrown in /in/r82We on line 33
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:
42.86 ms | 401 KiB | 8 Q