[TYPO3-core] t3lib_div::breakTextForEmail

Martin Kutschker Martin.Kutschker at n0spam-blackbox.net
Tue Oct 10 09:35:08 CEST 2006


Martin Kutschker schrieb:
> Wolfgang Klinger schrieb:
> 
>>  *hiya!*
>>
>>  On Mon, 09 Oct 2006, Martin Kutschker wrote the following:
>>
>>> Can somebody explain why array_merge is used to append a string to an 
>>> array?
>>
>>
>>
>>  You would favor array_push or what?
>>  What's the problem with array_merge beside that it's much slower
>>  (array_merge takes 33.694, array_push 10.49)?
> 
> 
> According to bug #4021 [1] it is a problem with PHP5.
> 
> Mind that array_merge operates with arrays not strings, so it's either 
> array_push() or $array[] but never array_merge().

So what now? Is it ok if I change (trunk and TYPO3_4-0)

$outArr = 
array_merge($outArr,t3lib_div::breakLinesForEmail($lStr,$implChar,$charWidth));

to

$outArr[] = t3lib_div::breakLinesForEmail($lStr,$implChar,$charWidth);

as breakLinesForEmail will always return a string?

Masi



More information about the TYPO3-team-core mailing list