Re: implode() speedup in PHP4

From: Date: Mon, 21 Mar 2005 19:50:58 +0000
Subject: Re: implode() speedup in PHP4
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-15526@lists.php.net to get a copy of this message
> After applying the change to ext/standard/string.c in PHP4 the following > Test failed: > Bug #22224 (implode changes object references in array) > [ext/standard/tests/strings/bug22224.phpt] > > Regards, > Christian Stadler I understood my fault. I didn't notice condition if (!(*ppzv)->is_ref) { } in convert_to_ex_master() macro. But compare execution time of the following test on PHP4 & PHP5: <? function getmicrotime() { list($usec, $sec) = explode(" ", microtime()); return ((float)$usec + (float)$sec); } $t = getmicrotime(); $s = str_repeat('a', 1 << 24); $a = implode(",", array($s, $s)); echo getmicrotime() - $t; ?> I think, it will be good idea to fix such time wasting in PHP4.

« previous php.internals (#15526) next »