mirror of
https://github.com/php/php-src.git
synced 2024-11-27 20:03:40 +08:00
d5373eac46
Fixes GH-9407 Closes GH-9471
25 lines
499 B
PHP
25 lines
499 B
PHP
--TEST--
|
|
GH-9407: LSP error in eval'd code refers to wrong class for static type
|
|
--FILE--
|
|
<?php
|
|
|
|
class A {
|
|
public function duplicate(): static {}
|
|
}
|
|
|
|
class C {
|
|
public static function generate() {
|
|
eval(<<<PHP
|
|
class B extends A {
|
|
public function duplicate(): A {}
|
|
}
|
|
PHP);
|
|
}
|
|
}
|
|
|
|
C::generate();
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Declaration of B::duplicate(): A must be compatible with A::duplicate(): static in %s : eval()'d code on line %d
|