|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-04-18 16:45 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 02:00:01 2025 UTC |
Description: ------------ When using str_replace() in a way it might not be thought (inside a while-loop where the statement is the actual str_replace one...) for (but still a valid one) it crashes php. This is 4 lines of code... It just takes a while (less than a minute for me) before php actually crashes. I have not seen any updates on this bug in 4.3.5 or 4.3.6... Reproduce code: --------------- $string="I hate double spaces."; while ($string=str_replace(" "," ",$string)) { $string=str_replace(" "," ",$string); } Expected result: ---------------- I expected $string to be: "I hate double spaces." I did not realise that str_replace() did this without the while loop... So everything works like a charm for me, but it might be problematic for other people? Actual result: -------------- A chrash... it takes a while and then apache restarts...