[php-src] Issue #14874: Incorrect lineno for property and class const variance check
| From: | iluuu1994 | Date: | Mon, 08 Jul 2024 13:25:29 +0000 |
| Subject: | [php-src] Issue #14874: Incorrect lineno for property and class const variance check | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-247251@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/14874
Author: iluuu1994
### Description
The following code:
```php
<?php
class C extends P {
public const int X = 42;
}
class P {
public const string X = 'X';
}
```
https://3v4l.org/IKY5H#v8.3.9
Resulted in this output:
```
Fatal error: Type of C::X must be compatible with P::X of type string in /in/ZAZYv on line 3
```
But I expected this output instead:
```
Fatal error: Type of C::X must be compatible with P::X of type string in /in/ZAZYv on line 4
```
Same goes for properties. From property hooks feedback:
https://github.com/php/php-src/pull/13455#discussion_r1499322256
### PHP Version
*
### Operating System
_No response_