The $_ENV global is only populated if the php.ini setting variables_order contains an "E", while $_SERVER always contains the environment variables. php.ini from the PHP GIT repo contains this:
; variables_order
; Default Value: "EGPCS"
; Development Value: "GPCS"
; Production Value: "GPCS"
On Ubuntu, it's explicitely set as follows: /etc/php/7.4/cli/php.ini:variables_order = "GPCS"
The $_ENV global is only populated if the php.ini setting variables_order contains an "E", while $_SERVER always contains the environment variables. php.ini from the PHP GIT repo contains this:
On Ubuntu, it's explicitely set as follows:
/etc/php/7.4/cli/php.ini:variables_order = "GPCS"
See issue #265