Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are phps mb_ereg functions safe to use (due to ereg being deprecated)?

Tags:

php

deprecated

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

But then I saw that the mb_ereg function haven't been marked as deprecated. So I am just wondering if it is save to rely on them? Is something known that they will also been declared deprecated soon or is it even a flaw in the documentation?

like image 414
enricog Avatar asked Nov 12 '10 14:11

enricog


1 Answers

I wouldn't depend on them. The preg functions are faster, more efficient, much more powerful and naively support UTF8. I would recommend using the preg functions for all of your regex needs.

But to directly answer your question, it does not appear that mb_ereg is deprecated...

like image 163
ircmaxell Avatar answered Nov 05 '22 10:11

ircmaxell