Skip to content

Commit 2bd72a3

Browse files
author
Joseph Lenton
committed
fixed bug with first line of stack trace
First lines in stack traces often contain magical PHP calls, wich PHP silently inserts into your code. In short, the stack does not reflect your code. This commit brings back previous behaviour, where the first line is by default taken from the source file, and not PHP.
1 parent e40a210 commit 2bd72a3

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/php_error.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2008,10 +2008,16 @@ private function parseStackTrace( $code, $message, $errLine, $errFile, &$stackTr
20082008

20092009
if ( $i === 0 && $altInfo !== null ) {
20102010
$info = $altInfo;
2011+
/*
2012+
* Skip for the first iteration,
2013+
* as it's usually magical PHP calls.
2014+
*/
20112015
} else if (
2012-
isset($trace['class']) ||
2013-
isset($trace['type']) ||
2014-
isset($trace['function'])
2016+
$i > 0 && (
2017+
isset($trace['class']) ||
2018+
isset($trace['type']) ||
2019+
isset($trace['function'])
2020+
)
20152021
) {
20162022
$args = array();
20172023
if ( isset($trace['args']) ) {

0 commit comments

Comments
 (0)