Antes de tudo registro a indignação de quererem que decoremos o php.net, mas enfim.. vamos lá.
A função getenv() quando invocada captura e retorna variáveis de ambiente.
Exemplo da saída com print_r(getenv());
Devolve um Array com as variáveis de ambiente do seu computador.
Array
(
[ALLUSERSPROFILE] => C:\ProgramData
[AMD_ENTRYPOINT] => vs/workbench/services/extensions/node/extensionHostProcess
[APPDATA] => C:\Users\wilal\AppData\Roaming
[APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL] => true
[CommonProgramFiles] => C:\Program Files\Common Files
[CommonProgramFiles(x86)] => C:\Program Files (x86)\Common Files
[CommonProgramW6432] => C:\Program Files\Common Files
[COMPOSE_CONVERT_WINDOWS_PATHS] => true
[COMPUTERNAME] => DESKTOP-C6SGTGE
[ComSpec] => C:\WINDOWS\system32\cmd.exe
[DriverData] => C:\Windows\System32\Drivers\DriverData
[ELECTRON_CRASHPAD_PIPE_NAME] => \\.\pipe\crashpad_12160_WBMWVAUPSBTGIGNO
[ELECTRON_RUN_AS_NODE] => 1
[FPS_BROWSER_APP_PROFILE_STRING] => Internet Explorer
[FPS_BROWSER_USER_PROFILE_STRING] => Default
[HOMEDRIVE] => C:
[HOMEPATH] => \Users\wilal
[LOCALAPPDATA] => C:\Users\wilal\AppData\Local
[LOGONSERVER] => \\DESKTOP-C6SGTGE
[MOZ_PLUGIN_PATH] => C:\PROGRAM FILES (X86)\FOXIT SOFTWARE\FOXIT READER\plugins\
[NUMBER_OF_PROCESSORS] => 4
[OneDrive] => C:\Users\wilal\OneDrive
[OneDriveConsumer] => C:\Users\wilal\OneDrive
[OS] => Windows_NT
[Path] => C:\Program Files (x86)\NetSarang\Xshell 6.......Resumi pra ficar melhor....
[PATHEXT] => .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
[PIPE_LOGGING] => true
[PROCESSOR_ARCHITECTURE] => AMD64
[PROCESSOR_IDENTIFIER] => Intel64 Family 6 Model 69 Stepping 1, GenuineIntel
[PROCESSOR_LEVEL] => 6
[PROCESSOR_REVISION] => 4501
[ProgramData] => C:\ProgramData
[ProgramFiles] => C:\Program Files
[ProgramFiles(x86)] => C:\Program Files (x86)
[ProgramW6432] => C:\Program Files
[PROMPT] => $P$G
[PSModulePath] => C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
... resumido...
[VSCODE_PID] => 12160
[windir] => C:\WINDOWS
)