3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data_arr= array("101","102","103","103","104","101","105","106","106","106","107","108","108","109","110","102","111"); $uniq = array(); $last = null; foreach ($data_arr as $elem) { if ($elem != $last) { $last = $elem; $uniq[] = $elem; } } echo implode(' ', $uniq);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 11
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 10
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 10
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/XTR3h
function name:  (null)
number of ops:  18
compiled vars:  !0 = $data_arr, !1 = $uniq, !2 = $last, !3 = $elem
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, <array>
    4     2        ASSIGN                                                   !2, null
    5     3      > FE_RESET_R                                       $7      !0, ->11
          4    > > FE_FETCH_R                                               $7, !3, ->11
    6     5    >   IS_NOT_EQUAL                                             !3, !2
          6      > JMPZ                                                     ~8, ->10
    7     7    >   ASSIGN                                                   !2, !3
    8     8        ASSIGN_DIM                                               !1
          9        OP_DATA                                                  !3
    5    10    > > JMP                                                      ->4
         11    >   FE_FREE                                                  $7
   12    12        INIT_FCALL                                               'implode'
         13        SEND_VAL                                                 '+'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                         $11     
         16        ECHO                                                     $11
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172.9 ms | 1395 KiB | 15 Q