note 111355 added to function.debug-backtrace

From: Date: Mon, 11 Feb 2013 09:59:07 +0000
Subject: note 111355 added to function.debug-backtrace
Groups: php.notes 
Request: Send a blank email to php-notes+get-193598@lists.php.net to get a copy of this message
Another variation formatting backtrace. Parameter $ignore to ignore the extra calls. <?php /** * Getting backtrace * * @param int $ignore ignore calls * * @return string */ protected function getBacktrace($ignore = 2) { $trace = ''; foreach (debug_backtrace() as $k => $v) { if ($k < $ignore) { continue; } array_walk($v['args'], function (&$item, $key) { $item = var_export($item, true); }); $trace .= '#' . ($k - $ignore) . ' ' . $v['file'] . '(' . $v['line'] . '): ' . (isset($v['class']) ? $v['class'] . '->' : '') . $v['function'] . '(' . implode(', ', $v['args']) . ')' . "\n"; } return $trace; } ---- Server IP: 69.147.83.199 Probable Submitter: 86.57.144.21 ---- Manual Page -- http://php.net/manual/en/function.debug-backtrace.php Edit -- https://master.php.net/note/edit/111355 Del: integrated -- https://master.php.net/note/delete/111355/integrated Del: useless -- https://master.php.net/note/delete/111355/useless Del: bad code -- https://master.php.net/note/delete/111355/bad+code Del: spam -- https://master.php.net/note/delete/111355/spam Del: non-english -- https://master.php.net/note/delete/111355/non-english Del: in docs -- https://master.php.net/note/delete/111355/in+docs Del: other reasons-- https://master.php.net/note/delete/111355 Reject -- https://master.php.net/note/reject/111355 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#193598) next »