3v4l.org

run code in 500+ PHP versions simultaneously
<?php $string = 'Super this is a test this is a test'; $arr = explode(' ', $string); $vals = array_count_values($arr); foreach ($arr as $key => $word) { if ($vals[$word] > 1) { unset($arr[$key]); } } echo implode(' ', $arr);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 18
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 18
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 17
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 17
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/hqOsm
function name:  (null)
number of ops:  22
compiled vars:  !0 = $string, !1 = $arr, !2 = $vals, !3 = $word, !4 = $key
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, 'Super+this+is+a+test+this+is+a+test'
    5     1        INIT_FCALL                                                   'explode'
          2        SEND_VAL                                                     '+'
          3        SEND_VAR                                                     !0
          4        DO_ICALL                                             $6      
          5        ASSIGN                                                       !1, $6
    6     6        INIT_FCALL                                                   'array_count_values'
          7        SEND_VAR                                                     !1
          8        DO_ICALL                                             $8      
          9        ASSIGN                                                       !2, $8
    8    10      > FE_RESET_R                                           $10     !1, ->18
         11    > > FE_FETCH_R                                           ~11     $10, !3, ->18
         12    >   ASSIGN                                                       !4, ~11
   10    13        FETCH_DIM_R                                          ~13     !2, !3
         14        IS_SMALLER                                                   1, ~13
         15      > JMPZ                                                         ~14, ->17
   11    16    >   UNSET_DIM                                                    !1, !4
    8    17    > > JMP                                                          ->11
         18    >   FE_FREE                                                      $10
   15    19        FRAMELESS_ICALL_2                implode             ~15     '+', !1
         20        ECHO                                                         ~15
         21      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
205.52 ms | 2139 KiB | 15 Q