php / php/php-src

Return INT value for some disk_* operations

オープン
#22,583 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

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

P.S.

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、PHP 関数 disk_free_space() と disk_total_space() の実装およびテストを見つけ、戻り値の扱いを filesize() と比較します。期待される整数の動作を確認し、両方の操作が一貫して整数を返すようにカバレッジを更新するとともに、大容量ディスクの有効な値を壊さないようにします。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
c, php
領域
operating-systems
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
55/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。