Return INT value for some disk_* operations
まだ誰も着手していません。
- 主要言語
- C
- スター
- 40.4k
- フォーク
- 8.2k
- 平均マージ
- 2日 13時間
- マージ済み PR(30日)
- 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 にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、PHP 関数 disk_free_space() と disk_total_space() の実装およびテストを見つけ、戻り値の扱いを filesize() と比較します。期待される整数の動作を確認し、両方の操作が一貫して整数を返すようにカバレッジを更新するとともに、大容量ディスクの有効な値を壊さないようにします。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- c, php
- 領域
- operating-systems
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 55/100