note 34337 added to function.str-replace

From: Date: Thu, 24 Jul 2003 10:34:06 +0000
Subject: note 34337 added to function.str-replace
Groups: php.notes 
Request: Send a blank email to php-notes+get-52545@lists.php.net to get a copy of this message
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"); ---- Manual Page -- http://www.php.net/manual/en/function.str-replace.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34337 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34337&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34337&report=yes

« previous php.notes (#52545) next »