3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = array(1,2,2,2,2,3,4,5,6,7); $array2 = array(3,4,2,2,2,7,8,9,10); foreach($array1 as $value) { if (in_array($value,$array2) && !in_array($value,$output["greens"])) { $output["greens"][]=$value; } else { $output["reds"][]=$value; } } print_r($output);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 25
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 25
Branch analysis from position: 4
2 jumps found. (Code = 46) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 21
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 16
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/9BO7N
function name:  (null)
number of ops:  30
compiled vars:  !0 = $array1, !1 = $array2, !2 = $value, !3 = $output
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, <array>
    5     2      > FE_RESET_R                                       $6      !0, ->25
          3    > > FE_FETCH_R                                               $6, !2, ->25
    7     4    >   INIT_FCALL                                               'in_array'
          5        SEND_VAR                                                 !2
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $7      
          8      > JMPZ_EX                                          ~8      $7, ->16
          9    >   INIT_FCALL                                               'in_array'
         10        SEND_VAR                                                 !2
         11        FETCH_DIM_R                                      ~9      !3, 'greens'
         12        SEND_VAL                                                 ~9
         13        DO_ICALL                                         $10     
         14        BOOL_NOT                                         ~11     $10
         15        BOOL                                             ~8      ~11
         16    > > JMPZ                                                     ~8, ->21
    9    17    >   FETCH_DIM_W                                      $12     !3, 'greens'
         18        ASSIGN_DIM                                               $12
         19        OP_DATA                                                  !2
         20      > JMP                                                      ->24
   13    21    >   FETCH_DIM_W                                      $14     !3, 'reds'
         22        ASSIGN_DIM                                               $14
         23        OP_DATA                                                  !2
    5    24    > > JMP                                                      ->3
         25    >   FE_FREE                                                  $6
   17    26        INIT_FCALL                                               'print_r'
         27        SEND_VAR                                                 !3
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
185.23 ms | 1396 KiB | 17 Q