locutus
Version:
Locutus other languages' standard libraries to JavaScript for fun and educational purposes
12 lines (11 loc) • 495 B
JavaScript
import { getPhpGlobalCallable } from "../_helpers/_phpRuntimeState.js";
export function function_exists(funcName) {
// discuss at: https://locutus.io/php/function_exists/
// original by: Kevin van Zonneveld (https://kvz.io)
// improved by: Steve Clay
// improved by: Legaev Andrey
// improved by: Brett Zamir (https://brett-zamir.me)
// example 1: function_exists('isFinite')
// returns 1: true
return typeof getPhpGlobalCallable(funcName) === 'function';
}