3v4l.org

run code in 300+ 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 = 7, Position 2 = 11
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/cXs9C
function name:  {closure}
number of ops:  14
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        INIT_FCALL                                               'in_array'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $2      
          6      > JMPZ                                                     $2, ->11
          7    >   NOP                                                      
          8        FAST_CONCAT                                      ~3      'prefix_', !0
          9        QM_ASSIGN                                        ~4      ~3
         10      > JMP                                                      ->12
         11    >   QM_ASSIGN                                        ~4      !0
         12    > > RETURN                                                   ~4
    8    13*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.87 ms | 1005 KiB | 16 Q