xref: /PHP-7.2/Zend/tests/traits/error_014.phpt (revision 7b7463bb)
1--TEST--
2Trying to override final method
3--FILE--
4<?php
5
6trait foo {
7	public function test() { return 3; }
8}
9
10class baz {
11	final public function test() { return 4; }
12}
13
14class bar extends baz {
15	use foo { test as public; }
16}
17
18$x = new bar;
19var_dump($x->test());
20
21?>
22--EXPECTF--
23Fatal error: Cannot override final method baz::test() in %s on line %d
24