3v4l.org

run code in 300+ PHP versions simultaneously
<?php $subscriberTags = json_decode('{"hu":2174325}'); $availableTags = json_decode('{"cz":2174305,"hu":2174325,"at":2174333,"de":2174353,"pl":2174365,"sk":2174373,"gb":2174381,"nl":2174385,"gr":2174877,"ru":2174881}'); $actualSubscriberTags = []; $addTags = []; $removeTags = []; foreach (['us', 'hu'] as $offer) { $actualSubscriberTags[] = $country; if (!array_key_exists($country, $subscriberTags) && !in_array($country, $addTags)) { $addTags[] = $country; } } foreach (array_keys($subscriberTags) as $tag) { if (!in_array($tag, $actualSubscriberTags) && !in_array($tag, $removeTags)) { $removeTags[] = $tag; } } foreach ($addTags as $tag) { if (!array_key_exists($tag, $availableTags)) { $return = $this->baseService->createTag(self::LIST_ID_LANDLORDS, $tag); $availableTags[$tag] = $return['id']; } echo 'ADD ' . $availableTags[$tag] . PHP_EOL; } foreach ($removeTags as $tag) { echo 'REMOVE ' . $availableTags[$tag] . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 28
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 28
Branch analysis from position: 13
2 jumps found. (Code = 46) Position 1 = 18, Position 2 = 24
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 27
Branch analysis from position: 24
Branch analysis from position: 28
2 jumps found. (Code = 77) Position 1 = 33, Position 2 = 50
Branch analysis from position: 33
2 jumps found. (Code = 78) Position 1 = 34, Position 2 = 50
Branch analysis from position: 34
2 jumps found. (Code = 46) Position 1 = 40, Position 2 = 46
Branch analysis from position: 40
2 jumps found. (Code = 43) Position 1 = 47, Position 2 = 49
Branch analysis from position: 47
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
Branch analysis from position: 49
Branch analysis from position: 46
Branch analysis from position: 50
2 jumps found. (Code = 77) Position 1 = 52, Position 2 = 72
Branch analysis from position: 52
2 jumps found. (Code = 78) Position 1 = 53, Position 2 = 72
Branch analysis from position: 53
2 jumps found. (Code = 43) Position 1 = 56, Position 2 = 67
Branch analysis from position: 56
1 jumps found. (Code = 42) Position 1 = 52
Branch analysis from position: 52
Branch analysis from position: 67
Branch analysis from position: 72
2 jumps found. (Code = 77) Position 1 = 74, Position 2 = 80
Branch analysis from position: 74
2 jumps found. (Code = 78) Position 1 = 75, Position 2 = 80
Branch analysis from position: 75
1 jumps found. (Code = 42) Position 1 = 74
Branch analysis from position: 74
Branch analysis from position: 80
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 80
Branch analysis from position: 72
Branch analysis from position: 50
Branch analysis from position: 28
filename:       /in/BGZmP
function name:  (null)
number of ops:  82
compiled vars:  !0 = $subscriberTags, !1 = $availableTags, !2 = $actualSubscriberTags, !3 = $addTags, !4 = $removeTags, !5 = $offer, !6 = $country, !7 = $tag, !8 = $return
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'json_decode'
          1        SEND_VAL                                                 '%7B%22hu%22%3A2174325%7D'
          2        DO_ICALL                                         $9      
          3        ASSIGN                                                   !0, $9
    4     4        INIT_FCALL                                               'json_decode'
          5        SEND_VAL                                                 '%7B%22cz%22%3A2174305%2C%22hu%22%3A2174325%2C%22at%22%3A2174333%2C%22de%22%3A2174353%2C%22pl%22%3A2174365%2C%22sk%22%3A2174373%2C%22gb%22%3A2174381%2C%22nl%22%3A2174385%2C%22gr%22%3A2174877%2C%22ru%22%3A2174881%7D'
          6        DO_ICALL                                         $11     
          7        ASSIGN                                                   !1, $11
    6     8        ASSIGN                                                   !2, <array>
    8     9        ASSIGN                                                   !3, <array>
    9    10        ASSIGN                                                   !4, <array>
   10    11      > FE_RESET_R                                       $16     <array>, ->28
         12    > > FE_FETCH_R                                               $16, !5, ->28
   12    13    >   ASSIGN_DIM                                               !2
         14        OP_DATA                                                  !6
   14    15        ARRAY_KEY_EXISTS                                 ~18     !6, !0
         16        BOOL_NOT                                         ~19     ~18
         17      > JMPZ_EX                                          ~19     ~19, ->24
         18    >   INIT_FCALL                                               'in_array'
         19        SEND_VAR                                                 !6
         20        SEND_VAR                                                 !3
         21        DO_ICALL                                         $20     
         22        BOOL_NOT                                         ~21     $20
         23        BOOL                                             ~19     ~21
         24    > > JMPZ                                                     ~19, ->27
   15    25    >   ASSIGN_DIM                                               !3
         26        OP_DATA                                                  !6
   10    27    > > JMP                                                      ->12
         28    >   FE_FREE                                                  $16
   19    29        INIT_FCALL                                               'array_keys'
         30        SEND_VAR                                                 !0
         31        DO_ICALL                                         $23     
         32      > FE_RESET_R                                       $24     $23, ->50
         33    > > FE_FETCH_R                                               $24, !7, ->50
   20    34    >   INIT_FCALL                                               'in_array'
         35        SEND_VAR                                                 !7
         36        SEND_VAR                                                 !2
         37        DO_ICALL                                         $25     
         38        BOOL_NOT                                         ~26     $25
         39      > JMPZ_EX                                          ~26     ~26, ->46
         40    >   INIT_FCALL                                               'in_array'
         41        SEND_VAR                                                 !7
         42        SEND_VAR                                                 !4
         43        DO_ICALL                                         $27     
         44        BOOL_NOT                                         ~28     $27
         45        BOOL                                             ~26     ~28
         46    > > JMPZ                                                     ~26, ->49
   21    47    >   ASSIGN_DIM                                               !4
         48        OP_DATA                                                  !7
   19    49    > > JMP                                                      ->33
         50    >   FE_FREE                                                  $24
   25    51      > FE_RESET_R                                       $30     !3, ->72
         52    > > FE_FETCH_R                                               $30, !7, ->72
   26    53    >   ARRAY_KEY_EXISTS                                 ~31     !7, !1
         54        BOOL_NOT                                         ~32     ~31
         55      > JMPZ                                                     ~32, ->67
   27    56    >   FETCH_THIS                                       $33     
         57        FETCH_OBJ_R                                      ~34     $33, 'baseService'
         58        INIT_METHOD_CALL                                         ~34, 'createTag'
         59        FETCH_CLASS_CONSTANT                             ~35     'LIST_ID_LANDLORDS'
         60        SEND_VAL_EX                                              ~35
         61        SEND_VAR_EX                                              !7
         62        DO_FCALL                                      0  $36     
         63        ASSIGN                                                   !8, $36
   28    64        FETCH_DIM_R                                      ~39     !8, 'id'
         65        ASSIGN_DIM                                               !1, !7
         66        OP_DATA                                                  ~39
   31    67    >   FETCH_DIM_R                                      ~40     !1, !7
         68        CONCAT                                           ~41     'ADD+', ~40
         69        CONCAT                                           ~42     ~41, '%0A'
         70        ECHO                                                     ~42
   25    71      > JMP                                                      ->52
         72    >   FE_FREE                                                  $30
   34    73      > FE_RESET_R                                       $43     !4, ->80
         74    > > FE_FETCH_R                                               $43, !7, ->80
   35    75    >   FETCH_DIM_R                                      ~44     !1, !7
         76        CONCAT                                           ~45     'REMOVE+', ~44
         77        CONCAT                                           ~46     ~45, '%0A'
         78        ECHO                                                     ~46
   34    79      > JMP                                                      ->74
         80    >   FE_FREE                                                  $43
   36    81      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
178.26 ms | 1404 KiB | 19 Q