note 101498 added to function.debug-backtrace

From: Date: Tue, 21 Dec 2010 11:09:45 +0000
Subject: note 101498 added to function.debug-backtrace
Groups: php.notes 
Request: Send a blank email to php-notes+get-175090@lists.php.net to get a copy of this message
Here's my little updated contribution - it prints colorful output in the way I prefer. Define a helper function isRootIp() that contains an array including your IP; then calls to bt() simply return, so you can sprinkle backtraces in live sites w/o anyone knowing. function bt() { if( ! isRootIp() ) { return false; } array_walk( debug_backtrace(), create_function( '$a,$b', 'print "<br /><b>". basename( $a[\'file\'] ). "</b> &nbsp; <font color=\"red\">{$a[\'line\']}</font> &nbsp; <font color=\"green\">{$a[\'function\']} ()</font> &nbsp; -- ". dirname( $a[\'file\'] ). "/";' ) ); } ---- Server IP: 64.71.164.2 Probable Submitter: 70.91.82.193 ---- Manual Page -- http://www.php.net/manual/en/function.debug-backtrace.php Edit -- https://master.php.net/note/edit/101498 Del: integrated -- https://master.php.net/note/delete/101498/integrated Del: useless -- https://master.php.net/note/delete/101498/useless Del: bad code -- https://master.php.net/note/delete/101498/bad+code Del: spam -- https://master.php.net/note/delete/101498/spam Del: non-english -- https://master.php.net/note/delete/101498/non-english Del: in docs -- https://master.php.net/note/delete/101498/in+docs Del: other reasons-- https://master.php.net/note/delete/101498 Reject -- https://master.php.net/note/reject/101498 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#175090) next »