Skip to content

Constant expressions are not optimized under some conditions #10729

Closed as not planned
@mvorisek

Description

@mvorisek

Description

The following code:

https://3v4l.org/Btrh0/rfc#vgit.master_jit

Resulted in this output:

float(0.1064751148223877)
float(0.07117080688476562)
float(0.3041820526123047)

But I expected this output instead:

float(0.1064751148223877)
float(0.07117080688476562)
float(0.07117080688476562)

I expect array_keys to be optimized to const with const input. 2nd and 3rn time must be about the same.

I also expect in_array to be optimized to use hash based 0(1) lookup when the array is const.

PHP Version

any

Operating System

any

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