[php-src] Issue #12069: PHP 8.3 | Incorrect error when using `static` on parameter in extended class
| From: | jrfnl | Date: | Mon, 28 Aug 2023 21:32:09 +0000 |
| Subject: | [php-src] Issue #12069: PHP 8.3 | Incorrect error when using `static` on parameter in extended class | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-245276@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/12069
Author: jrfnl
### Description
The following code:
```php
<?php
class Foo {
protected function doSomething(Reflection $a) {
return true;
}
}
class Bar extends Foo {
protected function doSomething(static $b) {
return true;
}
}
$obj = new Bar;
```
PHP 8.0 - 8.2: https://3v4l.org/c5r5q
PHP 8.3: https://3v4l.org/c5r5q/rfc#vgit.master
Resulted in this output:
```
Fatal error: Cannot use the static modifier on a promoted property in /in/c5r5q on line 10
```
But I expected this output instead:
```
Parse error: syntax error, unexpected token "static", expecting variable in /in/c5r5q on
line 10
```
Discovered by accident while creating a code sample to test something else completely.
### PHP Version
PHP 8.3.0-dev
### Operating System
_No response_