3v4l.org

run code in 300+ PHP versions simultaneously
<?php function dbg_bt($level = 0) { $currentLevel = 0; $level = (int)$level; $trace = debug_backtrace(); echo "\nBACKTRACE\n=========\n"; foreach ($trace as $data ) { $parsed = parse_dbg($data); echo sprintf("%03d %s\n", $currentLevel, $parsed); $currentLevel++; if ( 0 !== $level && $currentLevel >= $level) { break; } } echo "=========\n\n"; } function parse_dbg ($data) { if (!is_array($data)) { return ""; } if (!empty($data['type'])) { return sprintf( "[%s:%d] %s%s%s(%s)", $data['file'], $data['line'], $data['class'], $data['type'], $data['function'], get_args($data['args']) ); } else { return sprintf( "[%s:%d] %s(%s)", $data['file'], $data['line'], $data['function'], get_args($data['args']) ); } } function get_args($params) { if (!is_array($params)) { return ""; } $result = array(); foreach ($params as $val) { if('object' == gettype($val)) { $result[] = get_class($val); } else { $result[] = gettype($val); } } return implode(", ", $result); } class lol { static public function rofl($args = null) { ob_start(); dbg_bt(); $x = ob_get_contents(); ob_end_clean(); echo $x; // replace with trigger error } } echo "<pre>"; lol::rofl(new StdClass()); echo "Website content<br />".__FILE__."<br /><br /><br />";
Output for git.master, git.master_jit, rfc.property-hooks
<pre> BACKTRACE ========= 000 [/in/T72us:62] dbg_bt() 001 [/in/T72us:70] lol::rofl(stdClass) ========= Website content<br />/in/T72us<br /><br /><br />

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.72 ms | 401 KiB | 8 Q