cvs: ZendEngine2 /tests bug31177.phpt
| From: | Dmitry Stogov | Date: | Fri, 10 Jun 2005 10:45:14 +0000 |
| Subject: | cvs: ZendEngine2 /tests bug31177.phpt | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-3793@lists.php.net to get a copy of this message | ||
dmitry Fri Jun 10 06:45:14 2005 EDT
Modified files:
/ZendEngine2/tests bug31177.phpt
Log:
Added test file for bug #31177 (not fixed yet)
http://cvs.php.net/diff.php/ZendEngine2/tests/bug31177.phpt?r1=1.1&r2=1.2&ty=u
Index: ZendEngine2/tests/bug31177.phpt
diff -u /dev/null ZendEngine2/tests/bug31177.phpt:1.2
--- /dev/null Fri Jun 10 06:45:14 2005
+++ ZendEngine2/tests/bug31177.phpt Fri Jun 10 06:45:14 2005
@@ -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