mirror of
https://github.com/php/php-src.git
synced 2024-10-16 22:12:33 +00:00
24 lines
348 B
Plaintext
24 lines
348 B
Plaintext
|
--TEST--
|
||
|
Trying to override final method
|
||
|
--FILE--
|
||
|
<?php
|
||
|
|
||
|
trait foo {
|
||
|
public function test() { return 3; }
|
||
|
}
|
||
|
|
||
|
class baz {
|
||
|
final public function test() { return 4; }
|
||
|
}
|
||
|
|
||
|
class bar extends baz {
|
||
|
use foo { test as public; }
|
||
|
}
|
||
|
|
||
|
$x = new bar;
|
||
|
var_dump($x->test());
|
||
|
|
||
|
?>
|
||
|
--EXPECTF--
|
||
|
Fatal error: Cannot override final method baz::test() in %s on line %d
|