-
Notifications
You must be signed in to change notification settings - Fork 7.9k
FFI extension add FFI\CDef class and other update #8585
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
Conversation
sync master
sync master
sync master
sync master
While I agree that it should have been done this way from the start, I'm a bit unsure about the BC break this implicates. What's your suggestion how to write version agnostic code, allowing code to be written in PHP 8.0.0 and PHP 8.2.0? For handling class type hints I can polyfill |
so |
This cannot go into 8.1. It will need to go into 8.2, if it's accepted. |
I fully agree with @bwoebi's comment above; while it might better have been done this way from the beginning, I don't think we can change it for BC reasons. At least this should go through the RFC process. |
@cmb69 |
Yes. See https://wiki.php.net/rfc/howto on how to do it. |
OK,I'll submit it when I have free time |
I can not login to php wiki. so i maybe not submit the RFC. |
Why? What happens? There is a user |
Update:
FFI::cdef()
,FFI::load()
,FFI::scope()
returnFFI\CDef
instead ofFFI
object, call C function byFFI\CDef
objectFFI::hasSymbol(FFI\CDef $cdef, string $symbol, ?int $symbol_kind = null):bool
FFI::getSymbols(FFI\CDef $cdef, ?int $symbol_kind = null):array[FFI\CType]
methodsFFI::SYM_TYPE
,FFI::SYM_CONST
,FFI::SYM_VAR
,FFI::SYM_FUNC
constants$cdef
option paramter to end ofFFI::new()
,FFI::cast()
,FFI::type()
FFI::new()
,FFI::cast()
,FFI::type()
will be only static method,FFI
non-static method avoid taking up C function names, and not need exclude inzend_ffi_handlers.get_method
see #8554