New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FFI:Add support multiple instance struct pointer compatible and callback error contain args offset #5070
Conversation
…when Attempt to assign invalid callback
keep tab indent and change zend_ffi_create_callback() no paramter to `(uint32_t)-1`
sync from php/php-src
Synchronize master
hi @chopins,
<?php
$ffi = FFI::cdef("
size_t (*zend_printf)(const char *format, ...);
");
$ffi->zend_printf = function ($format, ...$args) {
var_dump($format, $args);
};
$f = $ffi->zend_printf;
$f("%s:%d:%d\n", "str", 5, 3);
?> Please, use separate patches//PRs for different features. |
@dstogov |
i remove variadic callbacks feature |
use pure php implement |
change:
1. zend_ffi_is_compatible_type()
support check same name struct pointer of multiple FFI instance
Pseudo code:
2. zend_ffi_create_callback()
report error message that contain offset of parameter
when has argc, will report below message:
Variadic function closures are not supported, parameter 1 occur
Attempt to assign parameter 1 to be invalid callback, %s
Attempt to assign parameter 1 to be invalid callback, insufficient number of arguments
Cannot allocate callback, parameter 1 occur