--TEST-- Test strtr() function : usage variations - empty string & null for 'str' argument --FILE-- "t", '' => "TEST"); /* loop through to test strtr() with each element of $str_arr */ for($index = 0; $index < count($str_arr); $index++) { echo "-- Iteration $count --\n"; $str = $str_arr[$index]; //getting the array element in 'str' variable //strtr() call in three args syntax form var_dump( strtr($str, $from, $to) ); //strtr() call in two args syntax form var_dump( strtr($str, $replace_pairs) ); $count++; } echo "*** Done ***"; ?> --EXPECT-- *** Testing strtr() : empty string & null for 'str' arg *** -- Iteration 1 -- string(0) "" string(0) "" -- Iteration 2 -- string(0) "" string(0) "" -- Iteration 3 -- string(0) "" string(0) "" -- Iteration 4 -- string(0) "" string(0) "" -- Iteration 5 -- string(0) "" string(0) "" *** Done ***