ID: 11448
Updated by: sniper
Reported By: [EMAIL PROTECTED]
Old-Status: Open
Status: Bogus
Bug Type: Unknown/Other Function
Operating system: 
PHP Version: 4.0.5
Assigned To: 
Comments:

Where does it say you can use function as the replacement?
You have to set it to variable first.


Previous Comments:
---------------------------------------------------------------------------

[2001-06-12 19:07:10] [EMAIL PROTECTED]
the following line:

$line = str_replace("pattern", Pattern(),$line);

where Pattern() is a function that returns a string.

Pattern executes everytime this code line is encountered, even if "pattern" is not a 
match on $line.

so if i loop through a file running that line, the function Pattern() will execute 
every single time, match or no match.

(my) common sense says this function should only execute when a match is found.  Is 
this a bug? I didn't know about it and something like this could seriously affect 
performance of a program.

Also I don't think the modules or any other of your requirements are relevant for this 
issue.

---------------------------------------------------------------------------



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=11448&edit=2


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to