mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00

This works similar to `dlsym(RTLD_DEFAULT, …)` with the caveat that symbols on Windows may not be unique, and are usually qualified by the module they are exported from. That means that wrong symbols may be fetched, potentially causing serious issues; therefore this usage is not recommended for production purposes, but is a nice simplification for quick experiments and the ext/ffi test suite. Closes GH-16351.
12 lines
317 B
PHP
12 lines
317 B
PHP
<?php
|
|
|
|
function ffi_get_fastcall_specifier()
|
|
{
|
|
foreach (['__attribute__((fastcall))', '__fastcall', '__vectorcall'] as $spec) {
|
|
try {
|
|
FFI::cdef("extern size_t $spec zend_list_insert(void *ptr, int type);");
|
|
return "$spec ";
|
|
} catch (Throwable $e) {}
|
|
}
|
|
return "";
|
|
}
|