A typical use for this exception, is in conjunction with the is_callable() function.
(PHP 5 >= 5.1.0, PHP 7)
Exception thrown if a callback refers to an undefined function or if some arguments are missing.
A typical use for this exception, is in conjunction with the is_callable() function.
Direct known subclasses:
BadMethodCallException
So BadMethodCallException can be used in case the subject function is or should be a part of class / object - it's use defines the case more precisely.
For example :
<?php
class Image
{
public function __construct()
{
if (!extension_loaded('gd'))
{
throw new BadFunctionCallException('GD extension is not loaded.');
}
}
}
?>