diff options
author | Marcus Boerger <helly@php.net> | 2003-06-21 22:02:16 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2003-06-21 22:02:16 +0000 |
commit | 4ff79c7d84c2fb65308a9a855505f9a41a67425d (patch) | |
tree | 9aa02e3a012578ba15189dcc6828a3bb3011c9cf /tests | |
parent | c8bebdaf67fd5f514322ad4cf36d16a107eab9a4 (diff) | |
download | php-git-4ff79c7d84c2fb65308a9a855505f9a41a67425d.tar.gz |
Add test case for final classes
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/classes/class_final.phpt | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/classes/class_final.phpt b/tests/classes/class_final.phpt new file mode 100755 index 0000000000..5f68dcd94b --- /dev/null +++ b/tests/classes/class_final.phpt @@ -0,0 +1,25 @@ +--TEST-- +A final class cannot be inherited +--SKIPIF-- +<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?> +--FILE-- +<?php + +final class base { + function show() { + echo "base\n"; + } +} + +$t = new base(); +$t->show(); + +class derived extends base { +} + +echo "Done\n"; // shouldn't be displayed +?> +--EXPECTF-- +base + +Fatal error: Class derived may not inherit from final class (base) in %s on line %d |