- function_exists: documentation ( source)
<?php
if(defined('B')) {
function b() {
echo "hello from `".__FUNCTION__."`\n";
}
}
echo function_exists("b") ? "b is defined\n" : "b is not defined\n";
a();
echo function_exists("b") ? "b is defined\n" : "b is not defined\n";
b();
a();
echo function_exists("b") ? "b is defined\n" : "b is not defined\n";