[php-src] Issue #9771: Location changed on error messages with PHP 8.2.0RCx
| From: | llaville | Date: | Tue, 18 Oct 2022 06:32:51 +0000 |
| Subject: | [php-src] Issue #9771: Location changed on error messages with PHP 8.2.0RCx | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-242623@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/9771
Author: llaville
### Description
The following code:
```php
<?php
MyClass
{
public static function oldFunction()
{
trigger_error(
vsprintf('Using "%s" is deprecated, use "%s" instead.',
[__METHOD__, __CLASS__ . '::newFunction']),
E_USER_DEPRECATED
);
}
public static function newFunction() { }
}
MyClass::oldFunction();
trigger_error("Cannot divide by zero", E_USER_ERROR);
```
Resulted in this output: see https://3v4l.org/uHoLn
Compare PHP 8.2
```
Deprecated: Using "MyClass::oldFunction" is deprecated, use
"MyClass::newFunction" instead. in /in/uHoLn on line 7
Fatal error: Cannot divide by zero in /in/uHoLn on line 17
```
and other versions
```
Deprecated: Using "MyClass::oldFunction" is deprecated, use
"MyClass::newFunction" instead. in /in/uHoLn on line 9
Fatal error: Cannot divide by zero in /in/uHoLn on line 17
```
But I expected this output instead: **Always the same line location** for each PHP versions
### PHP Version
PHP 8.2.0RC4
### Operating System
Ubuntu 18.04