[TYPO3-core] RFC: faster t3lib_div::inList

Oliver Hader oh at inpublica.de
Sat Aug 18 16:44:24 CEST 2007


Hi Franz,

Franz Holzinger schrieb:
> This is a SVN patch request.
> Type: Code cleanup
> Description:
> The t3lib_div::inList uses strstr inside. This is not recommended under
> http://php.net
> Note:  If you only want to determine if a particular needle  occurs
> within haystack, use the faster and less memory intensive function
> strpos() instead.
> Branches: Trunk
> Replace the strstr with the faster strpos function.
> Question:
> Would it make it easier for coding if even spaces would be allowed in
> this function betwenn the items and the commas ',' ? The description of
> the function does not tell that blanks are not allowed at the moment.
> If you agree I would enhance the patch for this.
> - Franz

Popy created a set of changes and performance improvements in t3lib_div.
A patch is available at bug-id #6037 in the bugtracker:
http://bugs.typo3.org/view.php?id=6037

t3lib_div:inList() is also part of the changes mentioned there. Since
these things would go to Trunk only and the requirement for TYPO3 4.2
will be PHP 5.2, it would also be possible to use foreach with
references, e.g. "foreach ($array as $key => &$value) { ... }".

I'm going to take Popy's patch, make some small changes and post it
here. Would this be okay with you?


olly
-- 
Oliver Hader
http://inpublica.de/


More information about the TYPO3-team-core mailing list