Call to undefined function ereg_replace()

General discussions related to php

Moderators: egami, macek, gesf

Post Reply
alexkhui
New php-forum User
New php-forum User
Posts: 1
Joined: Wed Apr 11, 2018 10:10 am

Wed Apr 11, 2018 10:17 am

We've recently upgraded to PHP 7.2 from 5.x and are aware of all the incompatiblity issues. We are getting an error each time we attempt to contact the server and the error is the following:

Fatal error: Uncaught Error: Call to undefined function ereg_replace() in....

When we check the file it complains about, we do not see the function being used. In fact we've done a global search through our entire PHP code base and we are not using any ereg_* functions. I don't understand how this is possible? Is it possible that there is some 3rd party library we are integrating with that is using this function and PHP is complaining about that? If so how do we go about isolating the library? The error shows up in files that don't have any ereg_* functions.

User avatar
hyper
php-forum Fan User
php-forum Fan User
Posts: 685
Joined: Mon Feb 22, 2016 5:52 pm

Wed Apr 11, 2018 11:07 am

Fatal error: Uncaught Error: Call to undefined function ereg_replace() in....
The file and line number should be given where you have put the dots following 'in'; look there first.

ereg_replace is deprecated so if you do find where it is, you will need to replace it all or create a function which does the same thing for you.
Is it possible that there is some 3rd party library we are integrating with that is using this function and PHP is complaining about that?
It's possible, but only you can answer that if you use one.

Post Reply