- function_exists: documentation ( source)
<?php
class test {
function register() {
if (!function_exists('test_init')) {
function test_init() {
echo 'Initializing library'.PHP_EOL;
}
}
}
}
$test = new test;
$test->register();
test_init();
?>