3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arr_one = [1,2,3,4,5]; $arr_two = [1,3,5]; $new_arr = array_map(function($arg) use ($arr_two) { return in_array($arg, $arr_two) ? "prefix_{$arg}" : $arg; }, $arr_one); var_dump($new_arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cXs9C
function name:  (null)
number of ops:  13
compiled vars:  !0 = $arr_one, !1 = $arr_two, !2 = $new_arr
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        ASSIGN                                                       !1, <array>
    6     2        INIT_FCALL                                                   'array_map'
          3        DECLARE_LAMBDA_FUNCTION                              ~5      [0]
          4        BIND_LEXICAL                                                 ~5, !1
    8     5        SEND_VAL                                                     ~5
          6        SEND_VAR                                                     !0
    6     7        DO_ICALL                                             $6      
          8        ASSIGN                                                       !2, $6
   10     9        INIT_FCALL                                                   'var_dump'
         10        SEND_VAR                                                     !2
         11        DO_ICALL                                                     
         12      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 4, Position 2 = 8
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cXs9C
function name:  {closure:/in/cXs9C:6}
number of ops:  11
compiled vars:  !0 = $arg, !1 = $arr_two
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   RECV                                                 !0      
          1        BIND_STATIC                                                  !1
    7     2        FRAMELESS_ICALL_2                in_array            ~2      !0, !1
          3      > JMPZ                                                         ~2, ->8
          4    >   NOP                                                          
          5        FAST_CONCAT                                          ~3      'prefix_', !0
          6        QM_ASSIGN                                            ~4      ~3
          7      > JMP                                                          ->9
          8    >   QM_ASSIGN                                            ~4      !0
          9    > > RETURN                                                       ~4
    8    10*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
209.41 ms | 2058 KiB | 15 Q