[php-src] Issue #8631: getcwd() mismatched drive letter case for Windows-paths
| From: | SailorMax | Date: | Wed, 25 May 2022 14:43:22 +0000 |
| Subject: | [php-src] Issue #8631: getcwd() mismatched drive letter case for Windows-paths | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-241587@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8631
Author: SailorMax
### Description
Function
getcwd() returns different results with php.exe and php-fpm.exe
Via php.exe it returns drive letter in upper case.
Via php-fpm.exe it returns drive letter in lower case.
The following code:
```php
<?php
function print_backtrace()
{
print debug_backtrace()[0]["file"];
}
print getcwd() . "\n";
print_backtrace();
```
Resulted in this output:
via php.exe
```
C:\test
C:\test\test.php
```
but via php-fpm.exe
```
c:\test
C:\test\test.php
```
But I expected this output in both cases:
```
C:\test
C:\test\test.php
```
### PHP Version
PHP 8.1.6
### Operating System
Windows 11 21H2