]> granicus.if.org Git - php/commitdiff
new test
authorAntony Dovgal <tony2001@php.net>
Fri, 13 Apr 2007 13:37:09 +0000 (13:37 +0000)
committerAntony Dovgal <tony2001@php.net>
Fri, 13 Apr 2007 13:37:09 +0000 (13:37 +0000)
Zend/tests/bug41075.phpt [new file with mode: 0644]

diff --git a/Zend/tests/bug41075.phpt b/Zend/tests/bug41075.phpt
new file mode 100644 (file)
index 0000000..ddeb7cc
--- /dev/null
@@ -0,0 +1,31 @@
+--TEST--
+Bug #41075(memleak when creating default object caused exception)
+--FILE--
+<?php
+
+function err($errno, $errstr, $errfile, $errline)
+{
+           throw new Exception($errstr);
+}
+
+set_error_handler("err");
+
+class test {
+    function foo() {
+        $var = $this->blah->prop = "string";
+        var_dump($this->blah);
+    }
+}
+
+$t = new test;
+try {
+    $t->foo();
+} catch (Exception $e) {
+    var_dump($e->getMessage());
+}
+
+echo "Done\n";
+?>
+--EXPECTF--    
+string(40) "Creating default object from empty value"
+Done