3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr1 = array(1,2,3); $arr2 = array(3,4,5); function compareArrays($arr1, &$arr2) { foreach($arr1 as $k => $v) { if (!in_array($v, $arr2)) { $arr2[$k] = 0; } } } compareArrays($arr1, $arr2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/05atf
function name:  (null)
number of ops:  7
compiled vars:  !0 = $arr1, !1 = $arr2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, <array>
   13     2        INIT_FCALL                                               'comparearrays'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_FCALL                                      0          
          6      > RETURN                                                   1

Function comparearrays:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 14
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 14
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 13
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/05atf
function name:  compareArrays
number of ops:  16
compiled vars:  !0 = $arr1, !1 = $arr2, !2 = $v, !3 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    6     2      > FE_RESET_R                                       $4      !0, ->14
          3    > > FE_FETCH_R                                       ~5      $4, !2, ->14
          4    >   ASSIGN                                                   !3, ~5
    7     5        INIT_FCALL                                               'in_array'
          6        SEND_VAR                                                 !2
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $7      
          9        BOOL_NOT                                         ~8      $7
         10      > JMPZ                                                     ~8, ->13
    8    11    >   ASSIGN_DIM                                               !1, !3
         12        OP_DATA                                                  0
    6    13    > > JMP                                                      ->3
         14    >   FE_FREE                                                  $4
   11    15      > RETURN                                                   null

End of function comparearrays

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.7 ms | 1399 KiB | 16 Q