#34505 [NEW]: Possible memory corruption.

From: Date: Wed, 14 Sep 2005 22:49:20 +0000
Subject: #34505 [NEW]: Possible memory corruption.
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-85060@lists.php.net to get a copy of this message
From: stochnagara at hotmail dot com Operating system: windows xp PHP version: 5CVS-2005-09-15 (snap) PHP Bug Type: Scripting Engine problem Bug description: Possible memory corruption. 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 bug report at http://bugs.php.net/?id=34505&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34505&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34505&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34505&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=34505&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=34505&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34505&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34505&r=needscript Try newer version: http://bugs.php.net/fix.php?id=34505&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34505&r=support Expected behavior: http://bugs.php.net/fix.php?id=34505&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34505&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34505&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=34505&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34505&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=34505&r=dst IIS Stability: http://bugs.php.net/fix.php?id=34505&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34505&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34505&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34505&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34505&r=mysqlcfg

« previous php.bugs (#85060) next »