[php-src] Issue #11533: inconsitent deprecation message with required paramteres and explizit nullable
| From: | verfriemelt-dot-org | Date: | Mon, 26 Jun 2023 07:49:53 +0000 |
| Subject: | [php-src] Issue #11533: inconsitent deprecation message with required paramteres and explizit nullable | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-244811@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/11533
Author: verfriemelt-dot-org
### Description
The following code:
```php
<?php
function foo(
int $a,
int $b = null,
int $c
) {}
function bar(
int $a,
?int $b = null,
int $c
) {}
```
Resulted in this output:
```
Deprecated: Optional parameter $b declared before required parameter $c is implicitly treated as a
required parameter in /tmp/preview on line 9
```
But I expected this output instead:
```
Deprecated: Optional parameter $b declared before required parameter $c is implicitly treated as a
required parameter in /tmp/preview on line 3
Deprecated: Optional parameter $b declared before required parameter $c is implicitly treated as a
required parameter in /tmp/preview on line 9
```
both functions have the same implicit
$b paramter due to $c beeing
required, shouldn't both then trigger the deprecation?
### PHP Version
PHP 8.2.7
### Operating System
_No response_