note 35835 deleted from function.strtr by didou

From: Date: Tue, 16 Sep 2003 14:35:01 +0000
Subject: note 35835 deleted from function.strtr by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-56575@lists.php.net to get a copy of this message
Note Submitter: hc at saustrup dot net ---- strtr() seems terribly slow - I tried using it to replace "@@SOMETHING@@" tokens in a semi-large string with a "translation array" as parameter. I expected it to be MUCH faster than ie. preg_replace( '/(@@\w+@@)/e','$translationArray["$1"]',$string), but when I timed 10000 calls to this function, strtok() about eight times slower?

« previous php.notes (#56575) next »