I am working on a project, in which i am using some deprecated function form the older version. But don't want my script to be stopped if used in the older version. So i am checking if the function exists and if it doesn't then creating it again.
But what is the difference between function_exists and is_callable in php and which one is better to user ?
if(!is_callable('xyz')) {
function xyz() {
// code goes here
}
}
OR
if(!function_exists('xyz')) {
function xyz() {
// code goes here
}
}