ID: 48004 Updated by: dmi...@php.net Reported By: daniel dot mueller at inexio dot net -Status: Verified +Status: Closed Bug Type: Scripting Engine problem Operating System: * PHP Version: 5.3CVS, 6CVS (2009-04-20) -Assigned To: +Assigned To: dmitry New Comment:
This bug has been fixed in CVS. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2009-04-20 15:58:43] j...@php.net Works with PHP_5_2, fails with PHP_5_3 and HEAD: ==5779== 20 bytes in 1 blocks are definitely lost in loss record 2 of 9 ==5779== at 0x4006AEE: malloc (vg_replace_malloc.c:207) ==5779== by 0x8350A92: _emalloc (zend_alloc.c:2304) ==5779== by 0x83C74CA: zend_assign_to_object (zend_execute.c:539) ==5779== by 0x841708A: ZEND_ASSIGN_OBJ_SPEC_CV_CONST_HANDLER (zend_vm_execute.h:23970) ==5779== by 0x839CB24: execute (zend_vm_execute.h:104) ==5779== by 0x83721EA: zend_execute_scripts (zend.c:1188) ==5779== by 0x83050F7: php_execute_script (main.c:2157) ==5779== by 0x8436E26: main (php_cli.c:1188) ------------------------------------------------------------------------ [2009-04-17 19:02:51] daniel dot mueller at inexio dot net The problem also exists in the latest CVS snapshot from today. ------------------------------------------------------------------------ [2009-04-17 11:27:53] daniel dot mueller at inexio dot net Description: ------------ The creation of a default object from an empty value triggers a warning with level E_STRICT. If an error handler catches this warning, in some cases the automatic initialization of the object fails. Without error handler, everything works as expected. Affected versions: 5.3.0RC1, 5.3.0alpha3 Not affected: 5.2.x Reproduce code: --------------- <? function error_handler($errno, $errstr, $errfile, $errline, $errcontext) { return true; } function test() { $data->id = 1; var_dump($data); } set_error_handler("error_handler"); test(); Expected result: ---------------- object(stdClass)#1 (1) { ["id"]=> int(1) } Actual result: -------------- NULL ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=48004&edit=1