|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-02-10 00:50 UTC] pollita@php.net
[2003-02-10 13:50 UTC] pollita@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 14:00:01 2025 UTC |
I was inadvertently including a fourth argument of "-1" with some instances of str_replace() -- since I got into the habit of the limit arg using preg_replace() -- and I noticed an odd behavior: str_replace("-embed-a-", "hey", "-embed-a-", -1) returns "hey," as expected. str_replace("-embed-a-", "hey", "-embed-b-", -1) returns "embed-b-," as expected. But str_replace("-embed-a-", "hey", "-embed-aa-", -1) hangs the script until the max execution time. Removing the extraneous argument made my script work properly, but I would expect PHP to either ignore the extra argument, or return an error, rather than hanging up completely. -Arlo