[php-src] Issue #8810: Wrong line number reported in case of a multiline parameter list
| From: | slapoguzov | Date: | Fri, 17 Jun 2022 10:44:44 +0000 |
| Subject: | [php-src] Issue #8810: Wrong line number reported in case of a multiline parameter list | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-241752@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8810
Author: slapoguzov
### Description
PHP reports the wrong line number in stacktrace in case of a multiline parameter list, for example:
```php
<?php
function test()
{
myAssert( //this line is expected to be reported
false,
"message" //this line will be reported
);
}
function myAssert($a, $b)
{
if(!$a) throw new ErrorException($b);
}
test();
```
The following stacktrace will be reported:
```
0.0001 394432 1. {main}() /Users/Aleksandr.Slapoguzov/PhpstormProjects/test/test2.php:0
0.0001 394432 2. test() /Users/Aleksandr.Slapoguzov/PhpstormProjects/test/test2.php:16
0.0001 394432 3. myAssert($a = FALSE, $b = 'message')
/Users/Aleksandr.Slapoguzov/PhpstormProjects/test/test2.php:7
```
But I expected this output instead:
```
0.0001 394432 1. {main}() /Users/Aleksandr.Slapoguzov/PhpstormProjects/test/test2.php:0
0.0001 394432 2. test() /Users/Aleksandr.Slapoguzov/PhpstormProjects/test/test2.php:16
0.0001 394432 3. myAssert($a = FALSE, $b = 'message')
/Users/Aleksandr.Slapoguzov/PhpstormProjects/test/test2.php:5
```
Although the 7th line is part of the failed function call, it would be better to report the 5th
line.
### PHP Version
PHP 8.1.0
### Operating System
MacOS