note 59713 added to function.debug-backtrace

From: Date: Wed, 14 Dec 2005 06:37:40 +0000
Subject: note 59713 added to function.debug-backtrace
Groups: php.notes 
Request: Send a blank email to php-notes+get-100108@lists.php.net to get a copy of this message
It should be noted that if an internal php function such as call_user_func in the backtrace, the 'file' and 'line' entries will not be set. Most debug tracers will use these entries. You should place a check to see if the key exists in the array before using this function. Otherwise notices will be generated. <?php $arrTrace = debug_backtrace(); foreach ($arrTrace as $arr) { if (!isset ($arr['file'])) { $arr['file'] = '[PHP Kernel]'; } if (!isset ($arr['line'])) { $arr['line'] = ''; } // Do something } ?> ---- Manual Page -- http://www.php.net/manual/en/function.debug-backtrace.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+59713 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+59713&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+59713&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+59713&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+59713&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+59713&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+59713&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+59713&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+59713&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#100108) next »