summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2002-11-21 15:06:54 +0000
committerMarcus Boerger <helly@php.net>2002-11-21 15:06:54 +0000
commitb66a39eb6e7b20f8ab1e4ad3d52409a500a721f9 (patch)
treec108079987311381e863dbce27ddb0bde96972bc /tests
parentb7cd48efddacffe4fd864b0a1692d465719dd1bd (diff)
downloadphp-git-b66a39eb6e7b20f8ab1e4ad3d52409a500a721f9.tar.gz
Test: An abstract function can be overwritten but not called
Diffstat (limited to 'tests')
-rw-r--r--tests/classes/abstract.phpt29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/classes/abstract.phpt b/tests/classes/abstract.phpt
new file mode 100644
index 0000000000..365e5f2862
--- /dev/null
+++ b/tests/classes/abstract.phpt
@@ -0,0 +1,29 @@
+--TEST--
+An abstrcat function may not be called
+--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 call abstract method show() in %s on line %d \ No newline at end of file