Return INT value for some disk_* operations
还没有人认领这个 Issue。
- 主要语言
- C
- 星标
- 40.4k
- 派生
- 8.1k
- 平均合并
- 2 天 13 小时
- 30 天内合并 PR
- 96
描述
Description
Currently (and for who knows how many years), a number of functions responsible for working with the file system return float values instead of integers.
Does this seem confusing? A fractional number of bytes? How so?
One might assume that in the days of the 32-bit PHP, the integer type wasn't large enough to accommodate the possible disk sizes of the time, but in 2026, this seems absurd. Not to mention that comparing floating-point numbers is an ambiguous operation.
Functions that return float values instead of integers are:
- https://www.php.net/manual/en/function.disk-free-space.php
- https://www.php.net/manual/en/function.disk-total-space.php
P.S.
The behavior looks especially strange considering that the function filesize returns an integer value...
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先定位 PHP 函数 disk_free_space() 和 disk_total_space() 的实现与测试,然后将它们的返回值处理方式与 filesize() 进行比较。确认预期的整数行为,并更新覆盖范围,使这两个操作都一致地返回整数,同时不破坏大容量磁盘的有效值。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- c, php
- 领域
- operating-systems
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 55/100