]> granicus.if.org Git - php/commitdiff
Test: An abstract function can be overwritten but not called
authorMarcus Boerger <helly@php.net>
Thu, 21 Nov 2002 15:06:54 +0000 (15:06 +0000)
committerMarcus Boerger <helly@php.net>
Thu, 21 Nov 2002 15:06:54 +0000 (15:06 +0000)
tests/classes/abstract.phpt [new file with mode: 0644]

diff --git a/tests/classes/abstract.phpt b/tests/classes/abstract.phpt
new file mode 100644 (file)
index 0000000..365e5f2
--- /dev/null
@@ -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