Hi everyone,

On 19.06.25 16:08, Marc Bennewitz wrote:
Hi,

During the discussion about the year 2038 issue it turned out that maybe it's time to drop support for 32-bit of PHP completely.

Based on that I have created an RFC to deprecate 32-bit build in 8.next and drop support for it in 9.

RFC: https://wiki.php.net/rfc/drop_32bit_support

I’m writing to let you know that I’ve decided not to move forward with the RFC to drop 32-bit support - at least for now.

While there are clear problems with continuing to support 32-bit PHP builds, such as:

 *

   additional complexity for the language itself and for library
   maintainers

 *

   Y2038 problem due to 32-bit integers used for Unix timestamps

 *

   File size limitations

 *

   Memory usage limitations

 *

   Issues with functions like |crc32|, |ip2long|, and |long2ip|
   returning negative values

there are still some valid use cases that currently don’t have ready-to-use alternatives.

The most significant of these identified is WebAssembly, which is actively used on for the PHP documentation and 3v4l.org. Although 64-bit WebAssembly support is nearly available in all major browsers, it’s still relatively new and not yet fully supported everywhere (Safari). Additionally, adopting 64-bit WebAssembly will require some effort from the affected projects.


Other use cases are more on the edge, like slightly older routers, embedded systems, X86-32 emulators and others, but the listed drawbacks may outweigh the benefits of these niche cases.

One argument I don’t consider strong is running 32bit builds of PHP on already supporting 64bit environments to save memory. While it's true, that 32-bit builds consumes less memory - it's actually not that much and it comes with a cost of being ~2.5 times slower.

           X64           X32           %
time:      0.005423069s  0.014256954s  262%
mem:       1127808b       914064b       81%
memReal:   4194304b      4194304b      100%
peak:      1128696b       914888b       81%
peakReal:  4194304b      4194304b      100%

That said, once WebAssembly has been fully adopted, I'll most likely revisit this RFC.

In the meantime, there are two possibilities to reduce the issues of 32-bit builds, though both would increase the complexity of PHP internals.

* consistent 64-bit integers on all platforms [1]
* native big integer support [2][3]

[1] https://github.com/php/php-src/pull/19079 (Draft)
[2] https://wiki.php.net/rfc/bigint (Withdrawn)
[3] https://github.com/php/php-src/pull/876 (Closed)



Attachment: OpenPGP_0x3936ABF753BC88CE.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to