Skip to content

Frameless call optimization broke IN_ARRAY DFA transformation #18050

Closed
@nielsdos

Description

@nielsdos

Description

The following code:

<?php
function test($v) {
    $ary = ['x', 'y'];
    var_dump(in_array($v, $ary));
}
test('x');

Resulted in this output (under opcache.opt_debug_level=0x400000):

BB0:
     ; start exit lines=[0-5]
     ; level=0
0000 #2.CV0($v) [any] = RECV 1
0001 INIT_FCALL 1 96 string("var_dump")
0002 #4.T3 [bool] = FRAMELESS_ICALL_2(in_array) #2.CV0($v) [any] array(...)
0003 SEND_VAL #4.T3 [bool] 1
0004 DO_ICALL
0005 RETURN null
bool(true)

But I expected this output instead (like in 8.3) (under opcache.opt_debug_level=0x400000):

BB0:
     ; start exit lines=[0-5]
     ; level=0
0000 #2.CV0($v) [any] = RECV 1
0001 INIT_FCALL 1 96 string("var_dump")
0002 #4.V3 [bool] = IN_ARRAY 0 #2.CV0($v) [any] array(...)
0003 SEND_VAR #4.V3 [bool] 1
0004 DO_ICALL
0005 RETURN null
bool(true)

PHP Version

8.4+

Operating System

No response

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