summaryrefslogtreecommitdiff
path: root/tests/classes/class_final.phpt
blob: 885b56595249bc0c564cce340fd9747b4dd03abf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--TEST--
ZE2 A final class cannot be inherited
--FILE--
<?php

final class base {
    function show() {
        echo "base\n";
    }
}

$t = new base();

class derived extends base {
}

echo "Done\n"; // shouldn't be displayed
?>
--EXPECTF--
Fatal error: Class derived may not inherit from final class (base) in %s on line %d