Testing undefined functions is not possible in a dynamic language. Note that undefined functions can occur in many ways:
undefined(); array_filter('undefined', $array); $prefix = 'un'; $f = $prefix.'defined'; $f();
This is in addition to the fact that there may be functions that are used and defined conditionally (through inclusion or otherwise). In the worst case scenario, consider this scenario:
if(time() & 1) { function foo() {} } foo();
Is the above program called by the undefined function?
source share