Return INT value for some disk_* operations
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 40.4k
- Forks
- 8.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 96
Description
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...
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the implementations and tests for the PHP functions disk_free_space() and disk_total_space(), then compare their return handling with filesize(). Confirm the expected integer behavior and update coverage so both operations consistently return integers without breaking valid large-disk values.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, php
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100