php / php/php-src

Return INT value for some disk_* operations

未关闭
#22,583 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Category: Engine Feature Status: Requires RFC
主要语言
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:

P.S.

The behavior looks especially strange considering that the function filesize returns an integer value...

贡献指南

打开贡献指南

从这里开始

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

调研方向

首先定位 PHP 函数 disk_free_space() 和 disk_total_space() 的实现与测试,然后将它们的返回值处理方式与 filesize() 进行比较。确认预期的整数行为,并更新覆盖范围,使这两个操作都一致地返回整数,同时不破坏大容量磁盘的有效值。

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

评估

技术栈
c, php
领域
operating-systems
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
55/100

把新 issue 发到你的邮箱

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