Annotation of embedaddon/php/tests/classes/class_abstract.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: ZE2 An abstract class cannot be instanciated
                      3: --SKIPIF--
                      4: <?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
                      5: --FILE--
                      6: <?php
                      7: 
                      8: abstract class base {
                      9:        function show() {
                     10:                echo "base\n";
                     11:        }
                     12: }
                     13: 
                     14: class derived extends base {
                     15: }
                     16: 
                     17: $t = new derived();
                     18: $t->show();
                     19: 
                     20: $t = new base();
                     21: $t->show();
                     22: 
                     23: echo "Done\n"; // shouldn't be displayed
                     24: ?>
                     25: --EXPECTF--
                     26: base
                     27: 
                     28: Fatal error: Cannot instantiate abstract class base in %s on line %d

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>