Skip to content

Integer overflow on 32bit PHP caused by GH-20601 #20823

Closed as duplicate
Closed as duplicate

Description

@tml

Description

The following code:

<?php
ftp_connect("localhost", 21, 90);

Resulted in this output:

Fatal error: Uncaught ValueError: ftp_connect(): Argument #3 ($timeout) must be less than -2147483648 in...

This problem is not reproducible on 64-bt PHP.

PHP Version

php -v
PHP 8.4.16 (cli) (built: Dec 23 2025 02:03:22) (ZTS)
Copyright (c) The PHP Group
Zend Engine v4.4.16, Copyright (c) Zend Technologies
    with Zend OPcache v8.4.16, Copyright (c), by Zend Technologies

uname:
Linux gatto.corradoroberto.it 6.1.144-server.corradoroberto.it #1 SMP PREEMPT_DYNAMIC Sat Jul 12 10:14:46 CEST 2025 i686 Intel(R) Core(TM) i5-9500 CPU @ 3.00GHz GenuineIntel GNU/Linux

Operating System

Any 32-bit Linux

Activity

  1. devnexen commented on Jan 2, 2026

    @devnexen
    Member

    If I recall, a fix about this will be present for 8.4.17

  2. iluuu1994 commented on Jan 3, 2026

    @iluuu1994
    Member

    As noted by @devnexen, the fix should be available in 8.4.17. Some thing did go wrong (see GH-20603), we'll discuss how to avoid that in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions