Just because I'm curious now, in what kind of situation would preg_replace be slower than ereg_replace, if ever?
Methonis
I think preg is always faster, but I never really tested.
Hmm, okies. Just wondering because on php.net in the ereg_replace() help it says that OFTEN preg_replace() was faster, so I was just curious if there were actually any times when it wouldn't be. (As I see preg_replace 99.99% of the time, and every once in a while will see ereg_replace)
Thanks,
Methonis
Ereg syntax can be clearer, but the engine behind it is less optimized and slower so it is almost always worse.
-[Unknown]
Got it, thanks. ;)
Methonis
Seeing as ereg_* functions are "Extended POSIX syntax" and preg_* are "Perl syntax" I imagine that it's possible for there to be certain things that can be done using ereg_* that can't be done directly with preg_* and in those cases, ereg_* may be faster.