guys, when "optimizing" functions you _shoudl_ write a testcase for the
working function and make _sure_ that it works afterwards!
while (zend_hash_get_current_data_ex(hash, (void **)&entry, &hpos) == SUCCESS) {
switch (zend_hash_get_current_key_ex(hash, &string_key, &string_key_len, &num_key, 0, &hpos)) {
case HASH_KEY_IS_STRING:
- len = string_key_len;
+ len = string_key_len-1;
if (len > maxlen) maxlen = len;
if (len < minlen) minlen = len;
break;
--- /dev/null
+--TEST--
+strtr() function
+--POST--
+--GET--
+--FILE--
+<?php
+$trans = array("hello" => "hi", "hi" => "hello","a" => "A","world" => "planet");
+echo strtr("# hi all, I said hello world! #", $trans) . "\n";
+?>
+--EXPECT--
+# hello All, I sAid hi planet! #