-
Notifications
You must be signed in to change notification settings - Fork 64
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
TRACK_VARS_REQUEST
seems to not be stored in http_globals
#331
Comments
BREAKING CHANGE: If you used `http_request_vars()` before it will now panic until a proper implementation is found. Refs: #331
Very weird as this constant lives here: https://github.com/php/php-src/blob/master/main/php_globals.h#L46 |
Ye, found the global both in the bindings file and in the zend code https://github.com/php/php-src/blob/50acf5eb15df4be623e01af7926688ce8fc7529b/main/php_globals.h#L46 But looking at the array size (https://github.com/php/php-src/blob/50acf5eb15df4be623e01af7926688ce8fc7529b/main/php_globals.h#L114) it is Searching for |
Ok, but it seems that it's related to Rust according to this issue: rust-lang/rust#90534 |
Sure, might be my limited c knowledge, but shouldn't the |
So as we know that the 6th index exists, we could tell the compiler to disable this warning on this specific line instead |
Just created a simple test: #![cfg_attr(windows, feature(abi_vectorcall))]
use ext_php_rs::prelude::*;
use ext_php_rs::zend::ProcessGlobals;
#[php_function]
pub fn hello_world(name: &str) -> String {
format!("Hello, {:?}!", ProcessGlobals::get().http_request_vars())
}
#[php_module]
pub fn get_module(module: ModuleBuilder) -> ModuleBuilder {
module
} Results in
|
Ok thank you for your test! |
BREAKING CHANGE: If you used `http_request_vars()` before it will now panic until a proper implementation is found. Refs: #331
BREAKING CHANGE: If you used `http_request_vars()` before it will now panic until a proper implementation is found. Refs: #331
BREAKING CHANGE: If you used `http_request_vars()` before it will now panic until a proper implementation is found. Refs: #331
Managed to get somewhere. Still only getting a |
Hmmm, from what I can see this might not be initialised all the time and needs some priming.
which does not include the Gonna do some more testing tomorrow. Pushed my experiments for reference. |
Ok, apparently |
@ptondereau got a working solution. Can you have a look at #334, haven't done that much with zend directly. Would still need to update the |
And of course it works differently on php80... |
Rust nightly build detects that the access in
ext-php-rs/src/zend/globals.rs
Line 287 in 0d9496b
Looking at the C code it seems that
TRACK_VARS_REQUEST
is not referenced anywhere.Maybe someone with more knowledge about php internals can point towards where to find the
$_REQUEST
super global.The text was updated successfully, but these errors were encountered: