Skip to main content

is_builtin_function

Function is_builtin_function 

Source
pub fn is_builtin_function(name: &str) -> bool
Expand description

Returns true if name is a known PHP built-in function.

Fast path: binary search on BUILTIN_FN_NAMES, a sorted compile-time slice generated from PhpStormStubsMap.php by build.rs.

Fallback (when BUILTIN_FN_NAMES is empty): reads the embedded stub slices and checks the embedded stubs and checks membership there.

ยงExample

assert!(mir_analyzer::stubs::is_builtin_function("strlen"));
assert!(!mir_analyzer::stubs::is_builtin_function("my_custom_function"));