diff options
author | Marcus Boerger <helly@php.net> | 2002-12-07 14:27:29 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2002-12-07 14:27:29 +0000 |
commit | 8e268d281640f1da50b970f6da2408d323544fd1 (patch) | |
tree | 3665167609af65af19dd27cc5981d82fd3bff2da | |
parent | 495f544d4bea4a55054b7e8220487b93d5a930ab (diff) | |
download | php-git-8e268d281640f1da50b970f6da2408d323544fd1.tar.gz |
Adding a test for abstract class instanciation
-rw-r--r-- | tests/classes/abstract_class.phpt | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/classes/abstract_class.phpt b/tests/classes/abstract_class.phpt new file mode 100644 index 0000000000..aa0a90dc88 --- /dev/null +++ b/tests/classes/abstract_class.phpt @@ -0,0 +1,29 @@ +--TEST-- +An abstract class cannot be instanciated +--SKIPIF-- +<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?> +--FILE-- +<?php + +class fail { + abstract function show(); +} + +class pass extends fail { + function show() { + echo "Call to function show()\n"; + } +} + +$t2 = new pass(); +$t2->show(); + +$t = new fail(); +$t->show(); + +echo "Done\n"; // shouldn't be displayed of cause +?> +--EXPECTF-- +Call to function show() + +Fatal error: Cannot instanciate abstract class fail in %s on line %d |