Re: call_stack

From: Date: Wed, 27 Nov 2002 21:21:59 +0000
Subject: Re: call_stack
References: 1 2 3 4 5 6 7  Groups: php.dev 
Request: Send a blank email to php-dev+get-91844@lists.php.net to get a copy of this message
George Schlossnagle wrote: > Is there a concensus on how arguments should be printed out? I quite like the output of foreach ($backtrace as $step) { if (!empty($step['args'])) { foreach ($step['args'] as $arg) { $args = isset($args) ? $args . ', ' : ''; $args .= var_export($arg, true); } } else { $args = ''; } $args = str_replace(array("\n", ',)'), array('', ')'), $args); printf( "%s%s(%s) [%s:%s]\n", isset($step['class']) ? $step['class'] . '::' : '', $step['function'], $args, $step['file'], $step['line'] ); } -- Sebastian Bergmann http://sebastian-bergmann.de/ http://phpOpenTracker.de/ Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/

« previous php.dev (#91844) next »