]> granicus.if.org Git - php/commitdiff
Add destructor inheritance test (bug #24637)
authorMarcus Boerger <helly@php.net>
Mon, 11 Aug 2003 00:02:32 +0000 (00:02 +0000)
committerMarcus Boerger <helly@php.net>
Mon, 11 Aug 2003 00:02:32 +0000 (00:02 +0000)
tests/classes/destructor_inheritance.phpt [new file with mode: 0755]

diff --git a/tests/classes/destructor_inheritance.phpt b/tests/classes/destructor_inheritance.phpt
new file mode 100755 (executable)
index 0000000..b9a4665
--- /dev/null
@@ -0,0 +1,29 @@
+--TEST--
+ZE2 The inherited destructor is called
+--SKIPIF--
+<?php if (version_compare(zend_version(), '2.0.0-dev', '<')) die('skip ZendEngine 2 needed'); ?>
+--FILE--
+<?php
+class base {
+   function __construct() {
+      echo __METHOD__ . "\n";
+   }
+   
+   function __destruct() {
+      echo __METHOD__ . "\n";
+   }
+}
+
+class derived extends base {
+}
+
+$obj = new derived;
+
+unset($obj);
+
+echo 'Done';
+?>
+--EXPECT--
+base::__construct
+base::__destruct
+Done
\ No newline at end of file