3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = "1385|1385|1385|1373|1373|1385|1373|1373|1373"; $b = explode("|", $a); $c = []; foreach($b as $id){ if (!in_array($id, $b)) $c[] = $id; } var_dump(join("|", $c));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 18
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 18
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
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/mDEKC
function name:  (null)
number of ops:  27
compiled vars:  !0 = $a, !1 = $b, !2 = $c, !3 = $id
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '1385%7C1385%7C1385%7C1373%7C1373%7C1385%7C1373%7C1373%7C1373'
    4     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '%7C'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $5      
          5        ASSIGN                                                   !1, $5
    5     6        ASSIGN                                                   !2, <array>
    6     7      > FE_RESET_R                                       $8      !1, ->18
          8    > > FE_FETCH_R                                               $8, !3, ->18
    8     9    >   INIT_FCALL                                               'in_array'
         10        SEND_VAR                                                 !3
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                         $9      
         13        BOOL_NOT                                         ~10     $9
         14      > JMPZ                                                     ~10, ->17
    9    15    >   ASSIGN_DIM                                               !2
         16        OP_DATA                                                  !3
    6    17    > > JMP                                                      ->8
         18    >   FE_FREE                                                  $8
   12    19        INIT_FCALL                                               'var_dump'
         20        INIT_FCALL                                               'join'
         21        SEND_VAL                                                 '%7C'
         22        SEND_VAR                                                 !2
         23        DO_ICALL                                         $12     
         24        SEND_VAR                                                 $12
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
209.06 ms | 1396 KiB | 21 Q