php / php/php-src

Return INT value for some disk_* operations

Open
#22,583 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Category: Engine Feature Status: Requires RFC
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:

P.S.

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.