Fix skipif c function check for PHP 7.4
@@ -86,7 +86,7 @@ function skip_if_darwin(): void
function skip_if_musl_libc(): void
{
- skip('Not support when use musl libc', !empty(`ldd 2>&1 | grep -i musl`));
+ skip('Not support when use musl libc', !empty(shell_exec('ldd 2>&1 | grep -i musl')));
}
function skip_if_in_valgrind(string $reason = 'valgrind is too slow'): void
@@ -114,7 +114,11 @@ function skip_if_c_function_not_exist(string $def, ?string $lib = null): void
skip_if_extension_not_exist('ffi');
try {
+ if ($lib) {
\FFI::cdef($def, $lib);
+ } else {
+ \FFI::cdef($def);
+ }
} catch (\Throwable $_) {
skip('"' . $def . '" not usable');
}
