1--TEST-- 2Bug #41075 (memleak when creating default object caused exception) 3--FILE-- 4<?php 5 6function err($errno, $errstr, $errfile, $errline) 7{ 8 throw new Exception($errstr); 9} 10 11set_error_handler("err"); 12 13class test { 14 function foo() { 15 $var = $this->blah->prop = "string"; 16 var_dump($this->blah); 17 } 18} 19 20$t = new test; 21try { 22 $t->foo(); 23} catch (Exception $e) { 24 var_dump($e->getMessage()); 25} 26 27echo "Done\n"; 28?> 29--EXPECTF-- 30string(40) "Creating default object from empty value" 31Done 32