mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Fixes GH-11388.
Following https://wiki.php.net/rfc/horizontalreuse which introduced traits,
this should be allowed.
The implementation was refactored in 3f8c729. That commit is the first time
the "final" check appears AFAICT, but no reason was given for why. That
commit seems to have landed in 5.4.11 and the NEWS for that version doesn't
seem to mention something relevant to the behaviour change.
This patch removes the restriction of the final modifier.
Closes GH-11394.
19 lines
266 B
PHP
19 lines
266 B
PHP
--TEST--
|
|
final alias
|
|
--FILE--
|
|
<?php
|
|
trait T1 {
|
|
function foo() {}
|
|
}
|
|
class C1 {
|
|
use T1 {
|
|
T1::foo as final;
|
|
}
|
|
}
|
|
class C2 extends C1 {
|
|
public function foo() {}
|
|
}
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Cannot override final method C1::foo() in %s on line %d
|