]> granicus.if.org Git - php/commitdiff
Add test against redeclaring an overloaded method abstract
authorMarcus Boerger <helly@php.net>
Sun, 24 Nov 2002 15:51:57 +0000 (15:51 +0000)
committerMarcus Boerger <helly@php.net>
Sun, 24 Nov 2002 15:51:57 +0000 (15:51 +0000)
tests/classes/abstract_redeclare.phpt [new file with mode: 0644]

diff --git a/tests/classes/abstract_redeclare.phpt b/tests/classes/abstract_redeclare.phpt
new file mode 100644 (file)
index 0000000..da037f0
--- /dev/null
@@ -0,0 +1,22 @@
+--TEST--
+A method cannot be redeclared abstrcat
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+
+class pass {
+       function show() {
+               echo "Call to function show()\n";
+       }
+}
+
+class fail extends pass {
+       abstract function show();
+}
+
+echo "Done\n"; // Shouldn't be displayed
+?>
+--EXPECTF--
+
+Fatal error: Cannot redeclare pass::show() abstract in class fail in %s on line %d