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)) { echo 'ADD TAG ' . $tag . PHP_EOL; $availableTags[$tag] = 'created' . rand(0, 100); } echo 'ADD TO USER' . $availableTags[$tag] . PHP_EOL; } foreach ($removeTags as $tag) { echo 'REMOVE FROM USER' . $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 = 71
Branch analysis from position: 52
2 jumps found. (Code = 78) Position 1 = 53, Position 2 = 71
Branch analysis from position: 53
2 jumps found. (Code = 43) Position 1 = 56, Position 2 = 66
Branch analysis from position: 56
1 jumps found. (Code = 42) Position 1 = 52
Branch analysis from position: 52
Branch analysis from position: 66
Branch analysis from position: 71
2 jumps found. (Code = 77) Position 1 = 73, Position 2 = 79
Branch analysis from position: 73
2 jumps found. (Code = 78) Position 1 = 74, Position 2 = 79
Branch analysis from position: 74
1 jumps found. (Code = 42) Position 1 = 73
Branch analysis from position: 73
Branch analysis from position: 79
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 79
Branch analysis from position: 71
Branch analysis from position: 50
Branch analysis from position: 28
filename:       /in/e1Hmn
function name:  (null)
number of ops:  81
compiled vars:  !0 = $subscriberTags, !1 = $availableTags, !2 = $actualSubscriberTags, !3 = $addTags, !4 = $removeTags, !5 = $offer, !6 = $country, !7 = $tag
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                                         $8      
          3        ASSIGN                                                   !0, $8
    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                                         $10     
          7        ASSIGN                                                   !1, $10
    6     8        ASSIGN                                                   !2, <array>
    8     9        ASSIGN                                                   !3, <array>
    9    10        ASSIGN                                                   !4, <array>
   10    11      > FE_RESET_R                                       $15     <array>, ->28
         12    > > FE_FETCH_R                                               $15, !5, ->28
   12    13    >   ASSIGN_DIM                                               !2
         14        OP_DATA                                                  !6
   14    15        ARRAY_KEY_EXISTS                                 ~17     !6, !0
         16        BOOL_NOT                                         ~18     ~17
         17      > JMPZ_EX                                          ~18     ~18, ->24
         18    >   INIT_FCALL                                               'in_array'
         19        SEND_VAR                                                 !6
         20        SEND_VAR                                                 !3
         21        DO_ICALL                                         $19     
         22        BOOL_NOT                                         ~20     $19
         23        BOOL                                             ~18     ~20
         24    > > JMPZ                                                     ~18, ->27
   15    25    >   ASSIGN_DIM                                               !3
         26        OP_DATA                                                  !6
   10    27    > > JMP                                                      ->12
         28    >   FE_FREE                                                  $15
   19    29        INIT_FCALL                                               'array_keys'
         30        SEND_VAR                                                 !0
         31        DO_ICALL                                         $22     
         32      > FE_RESET_R                                       $23     $22, ->50
         33    > > FE_FETCH_R                                               $23, !7, ->50
   20    34    >   INIT_FCALL                                               'in_array'
         35        SEND_VAR                                                 !7
         36        SEND_VAR                                                 !2
         37        DO_ICALL                                         $24     
         38        BOOL_NOT                                         ~25     $24
         39      > JMPZ_EX                                          ~25     ~25, ->46
         40    >   INIT_FCALL                                               'in_array'
         41        SEND_VAR                                                 !7
         42        SEND_VAR                                                 !4
         43        DO_ICALL                                         $26     
         44        BOOL_NOT                                         ~27     $26
         45        BOOL                                             ~25     ~27
         46    > > JMPZ                                                     ~25, ->49
   21    47    >   ASSIGN_DIM                                               !4
         48        OP_DATA                                                  !7
   19    49    > > JMP                                                      ->33
         50    >   FE_FREE                                                  $23
   25    51      > FE_RESET_R                                       $29     !3, ->71
         52    > > FE_FETCH_R                                               $29, !7, ->71
   26    53    >   ARRAY_KEY_EXISTS                                 ~30     !7, !1
         54        BOOL_NOT                                         ~31     ~30
         55      > JMPZ                                                     ~31, ->66
   27    56    >   CONCAT                                           ~32     'ADD+TAG+', !7
         57        CONCAT                                           ~33     ~32, '%0A'
         58        ECHO                                                     ~33
   28    59        INIT_FCALL                                               'rand'
         60        SEND_VAL                                                 0
         61        SEND_VAL                                                 100
         62        DO_ICALL                                         $35     
         63        CONCAT                                           ~36     'created', $35
         64        ASSIGN_DIM                                               !1, !7
         65        OP_DATA                                                  ~36
   31    66    >   FETCH_DIM_R                                      ~37     !1, !7
         67        CONCAT                                           ~38     'ADD+TO+USER', ~37
         68        CONCAT                                           ~39     ~38, '%0A'
         69        ECHO                                                     ~39
   25    70      > JMP                                                      ->52
         71    >   FE_FREE                                                  $29
   34    72      > FE_RESET_R                                       $40     !4, ->79
         73    > > FE_FETCH_R                                               $40, !7, ->79
   35    74    >   FETCH_DIM_R                                      ~41     !1, !7
         75        CONCAT                                           ~42     'REMOVE+FROM+USER', ~41
         76        CONCAT                                           ~43     ~42, '%0A'
         77        ECHO                                                     ~43
   34    78      > JMP                                                      ->73
         79    >   FE_FREE                                                  $40
   36    80      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.64 ms | 1409 KiB | 21 Q