Are mb_ereg php functions safe to use (due to deprecation of ereg)?

I just wanted my code to be compatible with php 5.3 (6.0). Therefore, I wanted to replace all calls with ereg functions with the corresponding preg functions.

But then I saw that the mb_ereg function is not marked as deprecated. So I'm just wondering if they should rely on them? Is it known that they will also be declared obsolete in the near future, or is this even a flaw in the documentation?

+4
source share
3 answers

I will not depend on them. Preg functions are faster, more efficient, much more powerful and naively support UTF8. I would recommend using preg functions for all your regular expression needs.

But for a direct answer to your question does not arise that mb_ereg out of date ...

+1
source

You can replace all ereg with mb_ereg if you want a quick solution and save time. mb_ereg not marked obsolete and is a direct replacement for ereg .

You can rely on it for a certain time or longer, we do not know. But if you have free time, I think it should be better, as ircmaxell suggests, replace all your mb_ereg with preg .

+4
source

mb_ereg not deprecated, but I would not rely on it because it will probably be. In addition, PCRE supports UTF-8 using the u modifier. See this answer .

+2
source

All Articles