note 34337 deleted from function.str-replace by didou
| From: | didou@php.net | Date: | Sat, 16 Aug 2003 09:51:27 +0000 |
| Subject: | note 34337 deleted from function.str-replace by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-54314@lists.php.net to get a copy of this message | ||
Note Submitter: igjav@cesga.es
----
on 16-Jul-2003 12:13, ? at hackingbord dot de wrote this about a post I wrote some time ago:
"yes, you are (wrong). the difference between both functions ist the speed of
execution...."
In your sample, the difference in the speed of execution is due to hashing algos speed
this (used in strtr):
$array = array("f" => "fff", "a" => "aaa",
"e" => "eee");
is aprox 2 times slower than this (used in str_replace):
$array1 = array("f", "a", "e");
$array2 = array("fff", "aaa", "eee");