PHP ereg vs. preg

后端 未结 5 937
猫巷女王i
猫巷女王i 2020-12-15 15:45

I have noticed in the PHP regex library there is a choice between ereg and preg. What is the difference? Is one faster than the other and if so, why isn\'t the slower one d

5条回答
  •  北海茫月
    2020-12-15 16:12

    Even though ereg is deprecated in PHP 5.3, the mb_ereg* functions are not. I believe the main reason for this is because PHP6 is rebuilding all MB/Unicode support and therefore the old "regular" ereg methods are useless since the mb_ereg will be newer/better.

    I know it doesn't answer the question regarding speed, but it does allow you to continue using both POSIX and PCRE.

提交回复
热议问题