xref: /PHP-8.1/tests/classes/final.phpt (revision f8d79582)
1--TEST--
2ZE2 A method may be redeclared final
3--FILE--
4<?php
5
6class first {
7    function show() {
8        echo "Call to function first::show()\n";
9    }
10}
11
12$t = new first();
13$t->show();
14
15class second extends first {
16    final function show() {
17        echo "Call to function second::show()\n";
18    }
19}
20
21$t2 = new second();
22$t2->show();
23
24echo "Done\n";
25?>
26--EXPECT--
27Call to function first::show()
28Call to function second::show()
29Done
30