[TYPO3-core] RFC: Feature Request #9656: Extend t3lib_div::trimExplode to limit the number of elements

Ingmar Schlecht ingmar at typo3.org
Tue Oct 28 16:16:04 CET 2008


Oliver Hader schrieb:
> Ingmar Schlecht schrieb:
>> Hi Olly,
>>
>> one more comment regarding this one:
>> As trimExplode is a quite highly used function, for performance reasons
>> I would propose to avoid the condition and always pass the limit
>> parameter on to explode(), a default value of 0 has the same effect as a
>> not-given parameter. Or make it NULL by default, that's what Eclipse
>> says is the default $limit parameter of explode().
>>
>> What do you think?
> 
> explode(',', 'item1,item2,item3', NULL) or explode(',',
> 'item1,item2,item3', 0) returns an array with a single array element.
> So, this does not work...

Not in my PHP version (5.3), but if it doesn't work for you that's still
a convincing argument not to do it like that...

All fine then.

cheers
Ingmar

-- 
Ingmar Schlecht
TYPO3 Association Active Member


More information about the TYPO3-team-core mailing list