summaryrefslogtreecommitdiff
path: root/Zend/tests/bug31177.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/tests/bug31177.phpt')
-rwxr-xr-xZend/tests/bug31177.phpt44
1 files changed, 44 insertions, 0 deletions
diff --git a/Zend/tests/bug31177.phpt b/Zend/tests/bug31177.phpt
new file mode 100755
index 000000000..ac0fd7289
--- /dev/null
+++ b/Zend/tests/bug31177.phpt
@@ -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