xref: /php-src/tests/classes/class_abstract.phpt (revision f8d79582)
1--TEST--
2ZE2 An abstract class cannot be instantiated
3--FILE--
4<?php
5
6abstract class base {
7    function show() {
8        echo "base\n";
9    }
10}
11
12class derived extends base {
13}
14
15$t = new derived();
16$t->show();
17
18$t = new base();
19$t->show();
20
21echo "Done\n"; // shouldn't be displayed
22?>
23--EXPECTF--
24base
25
26Fatal error: Uncaught Error: Cannot instantiate abstract class base in %s:%d
27Stack trace:
28#0 {main}
29  thrown in %s on line %d
30