Skip to content

zend_ssa_range_widening fails to converge on some input #19679

Closed

Description

@arnaud-lb

Description

The following code:

<?php
function test() {
    $a = PHP_INT_MIN+1;
    $b = 0;
    while ($b++ < 3) {
        $a = (int) ($a-- - $b - 1);
    }
    return $a;
}
var_dump(test());
?>

Causes zend_ssa_range_widening() to not converge (the process hangs).

The range of some variables is subsequently initialized to [-9223372036854775807..-9223372036854775807] and [-9223372036854775808..9223372036854775807] during warmup. The upper bound then decreases indefinitely during the widening phase.

Found while creating more test cases for #19669.

PHP Version

master

Operating System

No response

Activity

  1. self-assigned this
    on Sep 3, 2025
  2. added a commit that references this issue on Sep 4, 2025
    bd88a54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions