Skip to content

Incorrect stack trace of function calls #16618

@YuanchengJiang

Description

@YuanchengJiang

Description

The following code:

<?php
function foo(int $a){
    $a=$a%10;var_dump($a);
    $a=$f=$a*(261740);var_dump($a);
    $a%0;var_dump($a);
}
foo(3);

Resulted in this output:

int(3)
int(785220)

Fatal error: Uncaught DivisionByZeroError: Modulo by zero in /tmp/test.php:5
Stack trace:
#0 /tmp/test.php(7): foo(785220)
#1 {main}
  thrown in /tmp/test.php on line 5

But I expected this output instead (JIT 1213):

int(3)
int(785220)

Fatal error: Uncaught DivisionByZeroError: Modulo by zero in /tmp/test.php:5
Stack trace:
#0 /tmp/test.php(7): foo(3)
#1 {main}
  thrown in /tmp/test.php on line 5

PHP Version

nightly

Operating System

ubuntu 22.04

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