getcwd() mismatched drive letter case for Windows directory

未关闭
#8,631 9 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
php

调研方向

在 Windows 11 上使用 PHP 8.1.6,分别通过 php.exe 和 php-cgi.exe 运行提供的 getcwd() 和 debug_backtrace() 脚本,重现该报告。比较两种输出中驱动器号的大小写,并在 PHP 源代码中追踪工作目录行为的差异。两个可执行文件返回相同的驱动器号大小写即表示完成。

由索引模型根据 Issue 内容生成。

描述

Category: Engine Feature OS: Windows Status: Needs Triage
Description

Function getcwd() returns different results with php.exe and php-cgi.exe
Via php.exe it returns drive letter in upper case.
Via php-cgi.exe it returns drive letter in lower case.

The following code:

<?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-cgi.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

主要语言
C
星标
40.4k
派生
8.2k
平均合并
2 天 15 小时
30 天内合并 PR
103

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

php/php-src 的其他 Issue

查看 php/php-src 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。