← All built-ins / ffi_load()

ffi_load()

unsafe
ffi_load(string $s): mixed

Parameters

NameTypeDescription
$pathstringshared library: "mylib.dll" / "libmy.so"

Return value

Library handle for ffi_call(), or false on failure. Requires unsafe.

Example

echo "// unsafe { $lib = ffi_load("user32.dll"); }";
// unsafe { $lib = ffi_load("user32.dll"); }

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

See also

ffi_call()free()