note 86985 added to class.errorexception
| From: | chrisATcmbuckleyDOTcoDOTuk at osu1 dot php dot net | Date: | Thu, 13 Nov 2008 12:24:50 +0000 |
| Subject: | note 86985 added to class.errorexception | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-146479@lists.php.net to get a copy of this message | ||
The backtrace of ErrorException is broken in PHP 5.2 (listed at http://bugs.php.net/bug.php?id=46449 and explained
at http://bugs.php.net/bug.php?id=45895#c140511).
A simple fix for your exception handler:
<?php
$backtrace = $exception->getTrace();
if ($exception instanceof ErrorException) {
for ($i = count($backtrace) - 1; $i > 0; --$i) {
$backtrace[$i]['args'] = $backtrace[$i - 1]['args'];
}
}
?>
----
Server IP: 92.48.74.199
Probable Submitter: 212.50.188.101
----
Manual Page -- http://www.php.net/manual/en/class.errorexception.php
Edit -- https://master.php.net/note/edit/86985
Del: integrated -- https://master.php.net/note/delete/86985/integrated
Del: useless -- https://master.php.net/note/delete/86985/useless
Del: bad code -- https://master.php.net/note/delete/86985/bad+code
Del: spam -- https://master.php.net/note/delete/86985/spam
Del: non-english -- https://master.php.net/note/delete/86985/non-english
Del: in docs -- https://master.php.net/note/delete/86985/in+docs
Del: other reasons-- https://master.php.net/note/delete/86985
Reject -- https://master.php.net/note/reject/86985
Search -- https://master.php.net/manage/user-notes.php