Return INT value for some disk_* operations
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C
- Sterne
- 40.4k
- Forks
- 8.1k
- Ø Merge
- 2 T. 13 Std.
- Gemergte PRs (30 T.)
- 96
Beschreibung
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...
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, die Implementierungen und Tests für die PHP-Funktionen disk_free_space() und disk_total_space() zu finden, und vergleiche dann ihre Behandlung der Rückgabewerte mit filesize(). Bestätige das erwartete Verhalten als Integer und erweitere die Abdeckung so, dass beide Operationen konsistent Integer zurückgeben, ohne gültige Werte für große Datenträger zu beeinträchtigen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- c, php
- Bereich
- operating-systems
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 55/100