The dependency zendframework/zend-diactoros does not allow an $_SERVER super-global with keys that are integers (is php valid), leading to a request crash ('white screen of death').
It's used by RequestIntegration on https://github.com/getsentry/sentry-php/blob/master/src/Integration/RequestIntegration.php#L101
To reproduce install sentry-symfony on an nginx + php-fpm environment and add the following line to the php-fpm pool config:
env[42] = crash
More details on: https://github.com/zendframework/zend-diactoros/issues/369
I would say that populating $_SERVER with custom values is not a good practice, but I can see how that shouldn't lead to a hard crash.
This is anyhow a downstream bug, so we shouldn't do anything. I'll leave this open to track the Diactoros issue.
I know, we are trying to update sentry-symfony version, and I don't now where the integer key comes from, but I lose lots of hours tracking this.
I open this here just for you to have the information so you could decide about to implement some defensive programming.
For reference: we are using env vars for config that we pass using php-fpm pool config. One env var happens to have the same name as a php constant so the constant is translated to it's value on the file, hence the integer key on $_SERVER global.
FTR: https://github.com/zendframework/zend-diactoros/pull/370 has been merged and released as 2.1.4.
Most helpful comment
I would say that populating
$_SERVERwith custom values is not a good practice, but I can see how that shouldn't lead to a hard crash.This is anyhow a downstream bug, so we shouldn't do anything. I'll leave this open to track the Diactoros issue.