|
Posted by NoWhereMan on 05/15/07 15:25
On 15 May 2007 07:25:57 -0700, ZeldorBlat wrote:
> If you post the code for the two functions you want me to compare I'll
> be happy to do so and post the results.
maybe something along these lines ? I'm not sure how much str_pad should
count but it should take about the same amount of time for both the
functions
-------------------------
function foo($count, $pad) {
$str = '';
for($i=0; $i<$count; $i++)
$str .= str_pad($i, $pad , "___");
return $str;
}
function bar($count, $pad) {
$str = array();
for($i=0; $i<$count; $i++)
$str[]= str_pad($i, $pad , "___");
return implode('', $str);
}
-------------------------
using large $count and $pad
dunno if this is test is valuable... it's the first thing I thought to
generate big different strings, without using a constant and without
randomizing
bye
--
NoWhereMan (e.v.)
-- http://www.nowhereland.it
-- http://flatpress.nowhereland.it
Navigation:
[Reply to this message]
|