3v4l.org

run code in 300+ PHP versions simultaneously
<?php $muLevelIds = [1,6,7,8,9]; $subjectLevelIds = [1,6,7,8]; $occLevelIds = []; var_dump(array_union($muLevelIds, $subjectLevelIds, $occLevelIds)); function array_union($muLevelIds, $subjectLevelIds, $occLevelIds) { $allLevelIds = [1,6,7,8,9]; if (!empty($muLevelIds) && !empty($subjectLevelIds) && !empty($occLevelIds)) { $combined = array_intersect($allLevelIds, $muLevelIds, $subjectLevelIds, $occLevelIds); } elseif (empty($muLevelIds) && !empty($subjectLevelIds) && !empty($occLevelIds)) { $combined = array_intersect($allLevelIds, $subjectLevelIds, $occLevelIds); } elseif (!empty($muLevelIds) && empty($subjectLevelIds) && !empty($occLevelIds)) { $combined = array_intersect($allLevelIds, $muLevelIds, $occLevelIds); } elseif (!empty($muLevelIds) && !empty($subjectLevelIds) && empty($occLevelIds)) { $combined = array_intersect($allLevelIds, $muLevelIds, $subjectLevelIds); } elseif (!empty($muLevelIds) && empty($subjectLevelIds) && empty($occLevelIds)) { $combined = array_intersect($allLevelIds, $muLevelIds); } elseif (empty($muLevelIds) && !empty($subjectLevelIds) && empty($occLevelIds)) { $combined = array_intersect($allLevelIds, $subjectLevelIds); } elseif (empty($muLevelIds) && empty($subjectLevelIds) && !empty($occLevelIds)) { $combined = array_intersect($allLevelIds, $occLevelIds); } elseif (empty($muLevelIds) && empty($subjectLevelIds) && empty($occLevelIds)) { $combined = []; } return $combined; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JrtDE
function name:  (null)
number of ops:  12
compiled vars:  !0 = $muLevelIds, !1 = $subjectLevelIds, !2 = $occLevelIds
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ASSIGN                                                   !0, <array>
    7     1        ASSIGN                                                   !1, <array>
    9     2        ASSIGN                                                   !2, <array>
   11     3        INIT_FCALL                                               'var_dump'
          4        INIT_FCALL_BY_NAME                                       'array_union'
          5        SEND_VAR_EX                                              !0
          6        SEND_VAR_EX                                              !1
          7        SEND_VAR_EX                                              !2
          8        DO_FCALL                                      0  $6      
          9        SEND_VAR                                                 $6
         10        DO_ICALL                                                 
   39    11      > RETURN                                                   1

Function array_union:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
2 jumps found. (Code = 46) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 23
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 128
Branch analysis from position: 128
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
2 jumps found. (Code = 46) Position 1 = 25, Position 2 = 28
Branch analysis from position: 25
2 jumps found. (Code = 46) Position 1 = 29, Position 2 = 32
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 33, Position 2 = 40
Branch analysis from position: 33
1 jumps found. (Code = 42) Position 1 = 128
Branch analysis from position: 128
Branch analysis from position: 40
2 jumps found. (Code = 46) Position 1 = 43, Position 2 = 45
Branch analysis from position: 43
2 jumps found. (Code = 46) Position 1 = 46, Position 2 = 49
Branch analysis from position: 46
2 jumps found. (Code = 43) Position 1 = 50, Position 2 = 57
Branch analysis from position: 50
1 jumps found. (Code = 42) Position 1 = 128
Branch analysis from position: 128
Branch analysis from position: 57
2 jumps found. (Code = 46) Position 1 = 60, Position 2 = 63
Branch analysis from position: 60
2 jumps found. (Code = 46) Position 1 = 64, Position 2 = 66
Branch analysis from position: 64
2 jumps found. (Code = 43) Position 1 = 67, Position 2 = 74
Branch analysis from position: 67
1 jumps found. (Code = 42) Position 1 = 128
Branch analysis from position: 128
Branch analysis from position: 74
2 jumps found. (Code = 46) Position 1 = 77, Position 2 = 79
Branch analysis from position: 77
2 jumps found. (Code = 46) Position 1 = 80, Position 2 = 82
Branch analysis from position: 80
2 jumps found. (Code = 43) Position 1 = 83, Position 2 = 89
Branch analysis from position: 83
1 jumps found. (Code = 42) Position 1 = 128
Branch analysis from position: 128
Branch analysis from position: 89
2 jumps found. (Code = 46) Position 1 = 91, Position 2 = 94
Branch analysis from position: 91
2 jumps found. (Code = 46) Position 1 = 95, Position 2 = 97
Branch analysis from position: 95
2 jumps found. (Code = 43) Position 1 = 98, Position 2 = 104
Branch analysis from position: 98
1 jumps found. (Code = 42) Position 1 = 128
Branch analysis from position: 128
Branch analysis from position: 104
2 jumps found. (Code = 46) Position 1 = 106, Position 2 = 108
Branch analysis from position: 106
2 jumps found. (Code = 46) Position 1 = 109, Position 2 = 112
Branch analysis from position: 109
2 jumps found. (Code = 43) Position 1 = 113, Position 2 = 119
Branch analysis from position: 113
1 jumps found. (Code = 42) Position 1 = 128
Branch analysis from position: 128
Branch analysis from position: 119
2 jumps found. (Code = 46) Position 1 = 121, Position 2 = 123
Branch analysis from position: 121
2 jumps found. (Code = 46) Position 1 = 124, Position 2 = 126
Branch analysis from position: 124
2 jumps found. (Code = 43) Position 1 = 127, Position 2 = 128
Branch analysis from position: 127
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 128
Branch analysis from position: 126
Branch analysis from position: 123
Branch analysis from position: 112
Branch analysis from position: 108
Branch analysis from position: 97
Branch analysis from position: 94
Branch analysis from position: 82
Branch analysis from position: 79
Branch analysis from position: 66
Branch analysis from position: 63
Branch analysis from position: 49
Branch analysis from position: 45
Branch analysis from position: 32
Branch analysis from position: 28
Branch analysis from position: 14
Branch analysis from position: 10
filename:       /in/JrtDE
function name:  array_union
number of ops:  130
compiled vars:  !0 = $muLevelIds, !1 = $subjectLevelIds, !2 = $occLevelIds, !3 = $allLevelIds, !4 = $combined
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
   16     3        ASSIGN                                                   !3, <array>
   18     4        ISSET_ISEMPTY_CV                                 ~6      !0
          5        BOOL_NOT                                         ~7      ~6
          6      > JMPZ_EX                                          ~7      ~7, ->10
          7    >   ISSET_ISEMPTY_CV                                 ~8      !1
          8        BOOL_NOT                                         ~9      ~8
          9        BOOL                                             ~7      ~9
         10    > > JMPZ_EX                                          ~7      ~7, ->14
         11    >   ISSET_ISEMPTY_CV                                 ~10     !2
         12        BOOL_NOT                                         ~11     ~10
         13        BOOL                                             ~7      ~11
         14    > > JMPZ                                                     ~7, ->23
   19    15    >   INIT_FCALL                                               'array_intersect'
         16        SEND_VAR                                                 !3
         17        SEND_VAR                                                 !0
         18        SEND_VAR                                                 !1
         19        SEND_VAR                                                 !2
         20        DO_ICALL                                         $12     
         21        ASSIGN                                                   !4, $12
         22      > JMP                                                      ->128
   20    23    >   ISSET_ISEMPTY_CV                                 ~14     !0
         24      > JMPZ_EX                                          ~14     ~14, ->28
         25    >   ISSET_ISEMPTY_CV                                 ~15     !1
         26        BOOL_NOT                                         ~16     ~15
         27        BOOL                                             ~14     ~16
         28    > > JMPZ_EX                                          ~14     ~14, ->32
         29    >   ISSET_ISEMPTY_CV                                 ~17     !2
         30        BOOL_NOT                                         ~18     ~17
         31        BOOL                                             ~14     ~18
         32    > > JMPZ                                                     ~14, ->40
   21    33    >   INIT_FCALL                                               'array_intersect'
         34        SEND_VAR                                                 !3
         35        SEND_VAR                                                 !1
         36        SEND_VAR                                                 !2
         37        DO_ICALL                                         $19     
         38        ASSIGN                                                   !4, $19
         39      > JMP                                                      ->128
   22    40    >   ISSET_ISEMPTY_CV                                 ~21     !0
         41        BOOL_NOT                                         ~22     ~21
         42      > JMPZ_EX                                          ~22     ~22, ->45
         43    >   ISSET_ISEMPTY_CV                                 ~23     !1
         44        BOOL                                             ~22     ~23
         45    > > JMPZ_EX                                          ~22     ~22, ->49
         46    >   ISSET_ISEMPTY_CV                                 ~24     !2
         47        BOOL_NOT                                         ~25     ~24
         48        BOOL                                             ~22     ~25
         49    > > JMPZ                                                     ~22, ->57
   23    50    >   INIT_FCALL                                               'array_intersect'
         51        SEND_VAR                                                 !3
         52        SEND_VAR                                                 !0
         53        SEND_VAR                                                 !2
         54        DO_ICALL                                         $26     
         55        ASSIGN                                                   !4, $26
         56      > JMP                                                      ->128
   24    57    >   ISSET_ISEMPTY_CV                                 ~28     !0
         58        BOOL_NOT                                         ~29     ~28
         59      > JMPZ_EX                                          ~29     ~29, ->63
         60    >   ISSET_ISEMPTY_CV                                 ~30     !1
         61        BOOL_NOT                                         ~31     ~30
         62        BOOL                                             ~29     ~31
         63    > > JMPZ_EX                                          ~29     ~29, ->66
         64    >   ISSET_ISEMPTY_CV                                 ~32     !2
         65        BOOL                                             ~29     ~32
         66    > > JMPZ                                                     ~29, ->74
   25    67    >   INIT_FCALL                                               'array_intersect'
         68        SEND_VAR                                                 !3
         69        SEND_VAR                                                 !0
         70        SEND_VAR                                                 !1
         71        DO_ICALL                                         $33     
         72        ASSIGN                                                   !4, $33
         73      > JMP                                                      ->128
   26    74    >   ISSET_ISEMPTY_CV                                 ~35     !0
         75        BOOL_NOT                                         ~36     ~35
         76      > JMPZ_EX                                          ~36     ~36, ->79
         77    >   ISSET_ISEMPTY_CV                                 ~37     !1
         78        BOOL                                             ~36     ~37
         79    > > JMPZ_EX                                          ~36     ~36, ->82
         80    >   ISSET_ISEMPTY_CV                                 ~38     !2
         81        BOOL                                             ~36     ~38
         82    > > JMPZ                                                     ~36, ->89
   27    83    >   INIT_FCALL                                               'array_intersect'
         84        SEND_VAR                                                 !3
         85        SEND_VAR                                                 !0
         86        DO_ICALL                                         $39     
         87        ASSIGN                                                   !4, $39
         88      > JMP                                                      ->128
   28    89    >   ISSET_ISEMPTY_CV                                 ~41     !0
         90      > JMPZ_EX                                          ~41     ~41, ->94
         91    >   ISSET_ISEMPTY_CV                                 ~42     !1
         92        BOOL_NOT                                         ~43     ~42
         93        BOOL                                             ~41     ~43
         94    > > JMPZ_EX                                          ~41     ~41, ->97
         95    >   ISSET_ISEMPTY_CV                                 ~44     !2
         96        BOOL                                             ~41     ~44
         97    > > JMPZ                                                     ~41, ->104
   29    98    >   INIT_FCALL                                               'array_intersect'
         99        SEND_VAR                                                 !3
        100        SEND_VAR                                                 !1
        101        DO_ICALL                                         $45     
        102        ASSIGN                                                   !4, $45
        103      > JMP                                                      ->128
   30   104    >   ISSET_ISEMPTY_CV                                 ~47     !0
        105      > JMPZ_EX                                          ~47     ~47, ->108
        106    >   ISSET_ISEMPTY_CV                                 ~48     !1
        107        BOOL                                             ~47     ~48
        108    > > JMPZ_EX                                          ~47     ~47, ->112
        109    >   ISSET_ISEMPTY_CV                                 ~49     !2
        110        BOOL_NOT                                         ~50     ~49
        111        BOOL                                             ~47     ~50
        112    > > JMPZ                                                     ~47, ->119
   31   113    >   INIT_FCALL                                               'array_intersect'
        114        SEND_VAR                                                 !3
        115        SEND_VAR                                                 !2
        116        DO_ICALL                                         $51     
        117        ASSIGN                                                   !4, $51
        118      > JMP                                                      ->128
   32   119    >   ISSET_ISEMPTY_CV                                 ~53     !0
        120      > JMPZ_EX                                          ~53     ~53, ->123
        121    >   ISSET_ISEMPTY_CV                                 ~54     !1
        122        BOOL                                             ~53     ~54
        123    > > JMPZ_EX                                          ~53     ~53, ->126
        124    >   ISSET_ISEMPTY_CV                                 ~55     !2
        125        BOOL                                             ~53     ~55
        126    > > JMPZ                                                     ~53, ->128
   33   127    >   ASSIGN                                                   !4, <array>
   36   128    > > RETURN                                                   !4
   39   129*     > RETURN                                                   null

End of function array_union

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.51 ms | 1408 KiB | 17 Q