3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array(1,1,2,3,4,4,5,6,7,7,8,9,9); $newArray = array(); foreach($array as $key => $value) { if($array[$key] == $array[$key--]) { continue; } else { $newArray[$key] = $value; } echo $value . '<br>'; } print_r($newArray);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 17
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/RnaLC
function name:  (null)
number of ops:  22
compiled vars:  !0 = $array, !1 = $newArray, !2 = $value, !3 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    6     2      > FE_RESET_R                                       $6      !0, ->17
          3    > > FE_FETCH_R                                       ~7      $6, !2, ->17
          4    >   ASSIGN                                                   !3, ~7
    8     5        FETCH_DIM_R                                      ~9      !0, !3
          6        POST_DEC                                         ~10     !3
          7        FETCH_DIM_R                                      ~11     !0, ~10
          8        IS_EQUAL                                                 ~9, ~11
          9      > JMPZ                                                     ~12, ->12
   10    10    > > JMP                                                      ->3
         11*       JMP                                                      ->14
   14    12    >   ASSIGN_DIM                                               !1, !3
         13        OP_DATA                                                  !2
   16    14        CONCAT                                           ~14     !2, '%3Cbr%3E'
         15        ECHO                                                     ~14
    6    16      > JMP                                                      ->3
         17    >   FE_FREE                                                  $6
   19    18        INIT_FCALL                                               'print_r'
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.66 ms | 1399 KiB | 15 Q