[Typo3-dev] Getting rid of preg_* function

Arco arco at appeltaart.mine.nu
Sun Mar 27 18:45:55 CEST 2005


As read on php.net:
preg_match(), which uses a Perl-compatible regular expression syntax, is often a faster alternative to ereg(). 

I learned that ereg should be avoided and the str_ functions should be used.
If an expression is needed preg should be used for the speed difference (don't know what impact though)

In my simple 3.6.2 setup I count:
find typo3 typo3conf -type f|xargs -n 1 -i fgrep preg_ "{}"|wc -l
203

In my simple 3.7.0 setup I count:
find typo3 typo3conf -type f|xargs -n 1 -i fgrep preg_ "{}"|wc -l
158

Can someone test this in a large extension setup?

Arco

> I had a look at the source: Currently there are only 30 usages of such
> functions, so it would be easy to change this.
> 
> My questions:
> - Are the PCRE functions faster than the Posix ereg_* functions?
> - Should we change it?
> - Should we update the coding guidelines and make it a rule to not use
> them?




More information about the TYPO3-dev mailing list