3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array("A", "B", "C", "D", "D", "D", "E", "F", "G", "G", "H", "I", "J"); $arr = array(); foreach($array as $row){ $pos = array_search($row, $arr); if($pos !== false) $arr[$pos] = ''; $arr[] = $row; } foreach($arr as $val){ echo $val."\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 16
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 16
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 13
Branch analysis from position: 16
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 22
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 22
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
Branch analysis from position: 16
filename:       /in/ZRenf
function name:  (null)
number of ops:  24
compiled vars:  !0 = $array, !1 = $arr, !2 = $row, !3 = $pos, !4 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, <array>
    6     2      > FE_RESET_R                                       $7      !0, ->16
          3    > > FE_FETCH_R                                               $7, !2, ->16
    7     4    >   INIT_FCALL                                               'array_search'
          5        SEND_VAR                                                 !2
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $8      
          8        ASSIGN                                                   !3, $8
    8     9        TYPE_CHECK                                  1018          !3
         10      > JMPZ                                                     ~10, ->13
    9    11    >   ASSIGN_DIM                                               !1, !3
         12        OP_DATA                                                  ''
   10    13    >   ASSIGN_DIM                                               !1
         14        OP_DATA                                                  !2
    6    15      > JMP                                                      ->3
         16    >   FE_FREE                                                  $7
   12    17      > FE_RESET_R                                       $13     !1, ->22
         18    > > FE_FETCH_R                                               $13, !4, ->22
   13    19    >   CONCAT                                           ~14     !4, '%0A'
         20        ECHO                                                     ~14
   12    21      > JMP                                                      ->18
         22    >   FE_FREE                                                  $13
   14    23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
290.65 ms | 1016 KiB | 14 Q