#34505 [Asn->Csd]: Possible memory corruption.

From: Date: Tue, 20 Sep 2005 11:21:02 +0000
Subject: #34505 [Asn->Csd]: Possible memory corruption.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-85277@lists.php.net to get a copy of this message
ID: 34505 Updated by: tony2001@php.net Reported By: stochnagara at hotmail dot com -Status: Assigned +Status: Closed Bug Type: Scripting Engine problem Operating System: windows xp PHP Version: 5CVS-2005-09-15 (snap) Assigned To: tony2001 New Comment: Fixed in 5.1, I'll merge the fix to 5.0 & HEAD soon. Previous Comments: ------------------------------------------------------------------------ [2005-09-15 01:01:25] tony2001@php.net Assigned to myself. IIRC I have even cooked a patch for it, but didn't apply for a reason. ------------------------------------------------------------------------ [2005-09-15 00:49:19] stochnagara at hotmail dot com Description: ------------ I know that the code below is senseless in this form, but I came across it accidentally. This code prodcues a dump of $b object variable which contains two members - 'd' and a strange member shown as ':private'. The name is ':private' when the last line is not present. When this line (echo $a->{4} or similar) is put in the script, var_dump ($b) starts to produce a different dump on each script run. A sample output is shown below. Reproduce code: --------------- <? $a['d'] = 4; $a[''] = 5; $b =(object)$a; var_dump($b); echo $a->{4}; Expected result: ---------------- Maybe object(stdClass)#1 (2) { array (['d'] => int(4), [''] => int(5)) } Actual result: -------------- A sample result is object(stdClass)#1 (2) { ["d"]=> int(4) ["¤:private"]=> int(5) } But '¤' is often another symbol or a sequence of symbols. Also it is sometimes just [":private"]. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=34505&edit=1

« previous php.bugs (#85277) next »