You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Doesn't compile when zend_long is 32-bit (32-bit PHP builds, e.g. wasm32 without ZEND_ENABLE_ZVAL_LONG64)Â #800
ext-php-rs doesn't compile against a PHP whose zend_long is 32-bit â any 32-bit PHP build: wasm32-unknown-emscripten without ZEND_ENABLE_ZVAL_LONG64, i686, armv7. Found while statically linking an ext-php-rs extension into an Emscripten build of PHP 8.5.10; reproduced on master (844d387) and 0.16.0.
Five spots assume zend_long is i64 (5 compile errors):
With those five changes the crate builds and the extension runs on 32-bit PHP (checked under node and in headless Chromium). Building PHP with -DZEND_ENABLE_ZVAL_LONG64 (as WordPress Playground does) also avoids it, which is presumably why it hasn't come up.
A related footgun, not strictly a bug: nothing checks that the zend_long width bindgen sees matches the target PHP. Playground's 64-bit zend_long comes from a CFLAGS define that isn't recorded in php_config.h, so leaving -DZEND_ENABLE_ZVAL_LONG64 off the bindgen/cc args silently produces a mismatched ABI. A compile-time assertion on size_of::<zend_long>() against something PHP does record (e.g. SIZEOF_ZEND_LONG, if present in the headers) might catch it.
Happy to send the patch as a PR if you'd like one.
Thanks report and this is expected as we currently don't document this platform.
Feel free to open a PR, but there is a lot a place even in Pure Rust that we use 64bits alignment and scalar type.
It should also prove the support through 8.2 to 8.5 with the CI
Activity
ptondereau commentedon Oct 3, 2026
Thanks report and this is expected as we currently don't document this platform.
Feel free to open a PR, but there is a lot a place even in Pure Rust that we use 64bits alignment and scalar type.
It should also prove the support through 8.2 to 8.5 with the CI