3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tags = ' #portugal #sagres #cabodesaovicente #love #travel #couple #holiday #vacation #ig_europe #landmark #reflections #ocean #europe #sky #reflection #water #people #sea #pretty #fun #beach #house #village #topeuropephotos #photo #photos #cloud #stone #sunset ' ; $pcs = array_map('trim', explode('#', $tags)); $found=[]; foreach($pcs as $piece){ if (array_key_exists($piece, $found)){ var_dump("tag already found: $piece"); continue; } $found[$piece]=true; } var_dump("found ".count($found)." tags");
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 12, Position 2 = 24
Branch analysis from position: 12
2 jumps found. (Code = 78) Position 1 = 13, Position 2 = 24
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 21
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/r1Gup
function name:  (null)
number of ops:  32
compiled vars:  !0 = $tags, !1 = $pcs, !2 = $found, !3 = $piece
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%0A%23portugal+%23sagres+%23cabodesaovicente+%23love+%23travel+%23couple+%23holiday+%23vacation+%23ig_europe+%23landmark+%23reflections+%23ocean+%23europe+%23sky+%23reflection+%23water+%23people+%23sea+%23pretty+%23fun+%23beach+%23house+%23village+%23topeuropephotos+%23photo+%23photos+%23cloud+%23stone+%23sunset%0A'
    7     1        INIT_FCALL                                               'array_map'
          2        SEND_VAL                                                 'trim'
          3        INIT_FCALL                                               'explode'
          4        SEND_VAL                                                 '%23'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $5      
          7        SEND_VAR                                                 $5
          8        DO_ICALL                                         $6      
          9        ASSIGN                                                   !1, $6
    9    10        ASSIGN                                                   !2, <array>
   10    11      > FE_RESET_R                                       $9      !1, ->24
         12    > > FE_FETCH_R                                               $9, !3, ->24
   11    13    >   ARRAY_KEY_EXISTS                                         !3, !2
         14      > JMPZ                                                     ~10, ->21
   12    15    >   INIT_FCALL                                               'var_dump'
         16        NOP                                                      
         17        FAST_CONCAT                                      ~11     'tag+already+found%3A+', !3
         18        SEND_VAL                                                 ~11
         19        DO_ICALL                                                 
   13    20      > JMP                                                      ->12
   15    21    >   ASSIGN_DIM                                               !2, !3
         22        OP_DATA                                                  <true>
   10    23      > JMP                                                      ->12
         24    >   FE_FREE                                                  $9
   18    25        INIT_FCALL                                               'var_dump'
         26        COUNT                                            ~14     !2
         27        CONCAT                                           ~15     'found+', ~14
         28        CONCAT                                           ~16     ~15, '+tags'
         29        SEND_VAL                                                 ~16
         30        DO_ICALL                                                 
         31      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.17 ms | 1396 KiB | 19 Q