[TYPO3-core] RFC: Remove empty label tags

Wolfgang Klinger wolfgang at stufenlos.net
Wed Jan 11 20:31:50 CET 2006


 Hiya!

 Karsten Dambekalns:
> Why preg_match? IMHO this
>  !in_array($confData['type'], array('radio','label','hidden','comment'))
> does the same as your
>  !preg_match('/^(radio|label|hidden|comment)$/',$confData['type'])
> and should/might be faster still.

 no, preg_match is faster:

 in a loop of 100 comparisons with the two above expressions the
 in_array calls require 0.002166 seconds, while the preg_match calls finish
 in only 0.001912 seconds. :-)

 go for it!


 kind regards
 Wolfgang

 ps: for one call only:
 preg_match: 0.00020900000000001
 in_array: 0.00021400000000000




More information about the TYPO3-team-core mailing list