]> granicus.if.org Git - php/commitdiff
Added test file for bug #31177 (not fixed yet)
authorDmitry Stogov <dmitry@php.net>
Fri, 10 Jun 2005 10:45:14 +0000 (10:45 +0000)
committerDmitry Stogov <dmitry@php.net>
Fri, 10 Jun 2005 10:45:14 +0000 (10:45 +0000)
Zend/tests/bug31177.phpt [new file with mode: 0755]

diff --git a/Zend/tests/bug31177.phpt b/Zend/tests/bug31177.phpt
new file mode 100755 (executable)
index 0000000..5e84573
--- /dev/null
@@ -0,0 +1,44 @@
+--TEST--
+Bug #31177 (Memory leak)
+--FILE--
+<?php
+class DbGow {
+
+       public function query() {
+               throw new Exception;
+       }
+       
+       public function select() {
+               return new DbGowRecordSet($this->query());
+       }
+
+       public function select2() {
+               new DbGowRecordSet($this->query());
+       }
+
+}
+
+class DbGowRecordSet {
+
+       public function __construct($resource) {
+       }
+
+}
+
+$db = new DbGow;
+
+try {
+       $rs = $db->select();
+} catch(Exception $e) {
+       echo "ok\n";
+}
+       
+try {
+       $db->select2();
+} catch(Exception $e) {
+       echo "ok\n";
+}
+?>
+--EXPECT--
+ok
+ok