← All built-ins / ffi_call()

ffi_call()

unsafe
ffi_call(...$args): mixed

Parameters

NameTypeDescription
$libresourcehandle from ffi_load()
$symbolstringexported function name

Return value

Callable for the native function. Requires unsafe.

Example

echo "// unsafe { $fn = ffi_call($lib, "MessageBoxA"); }";
// unsafe { $fn = ffi_call($lib, "MessageBoxA"); }

This call needs a real environment (window, server, database or stdin) — the snippet above shows the typical usage shape.

See also

ffi_load()