[TYPO3-core] RFC #10511: simplify and speed up t3lib_div::trimExplode()
Peter Foerger
pfoerger at gmail.com
Sat Feb 21 10:21:45 CET 2009
Hi,
Ingo Renner schrieb:
>
> Problem:
> currently trimExplode() uses loops to process elements of arrays created
> by an explode before.
>
>
> Solution:
> Using native php functions that achieve the same goal is simpler,
> shorter, and most importantly faster.
> To make sure the behavior stays as it is right now I created four unit
> tests.
>
GREAT! I haven't tested yet, just read your code.
Two remarks:
- will that work in terms of the expected result?:
t3lib_div::trimExplode(',', $testString, true, 3);
@see http://bugs.typo3.org/view.php?id=9779
- benchmark_trimExplode.php::trimExplode2()
the conditional should be 'if ($onlyNonEmptyValues){}' as
$removeEmptyValues is undefined.
Cheers,
Peter
More information about the TYPO3-team-core
mailing list