|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1999-11-13 13:37 UTC] thies at cvs dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sun Feb 15 15:00:01 2026 UTC |
I upgraded my 11/01/99 CVS build with the RC4 build (totally starting over from scratch), and started having some very strange problems when I started manipulating strings. Basically I have a string that is used for 'flags', (i.e. position 1 has a flag of A, position 2 B, etc.). Normally, I change these flags from a webpage by recursing through an array and changing individual characters.... but suddenly it stopped working, and has started segmentation faulting ... here's a code segment of the problem code: $inarray = array(1=>"A",2=>"B",3=>"C"); // etc... $string = "A--DF--S--DS---C"; while (list($key,$val) = each($inarray)) { echo "PRE: $string<br>"; $string[$key] = $val; echo "POST: $string<p>"; } ... this works for about 2 iterations, then we have major memory munging, and $string turns into a bunch of garbage.. (even a Yen symbol or three) after 2 more iterations, the Apache child process dies. I tried doing a few different things, including converting $string to an array first, then doing a individual element replace... but then I discovered that a reset($inarray) also segfaulted things.