3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = [1, 2, 3, 4, 3, 2, 1]; $j = count($a) - 1; $output = []; for($i = 0; $i > count($a); $i++) { if ($a[i] !== $a[j]) { $output = $a[i]; } } print_r($output);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 7
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 16
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 7
Branch analysis from position: 20
Branch analysis from position: 7
Branch analysis from position: 16
filename:       /in/j5tsm
function name:  (null)
number of ops:  24
compiled vars:  !0 = $a, !1 = $j, !2 = $output, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        COUNT                                            ~5      !0
          2        SUB                                              ~6      ~5, 1
          3        ASSIGN                                                   !1, ~6
    7     4        ASSIGN                                                   !2, <array>
    9     5        ASSIGN                                                   !3, 0
          6      > JMP                                                      ->17
   10     7    >   FETCH_CONSTANT                                   ~10     'i'
          8        FETCH_DIM_R                                      ~11     !0, ~10
          9        FETCH_CONSTANT                                   ~12     'j'
         10        FETCH_DIM_R                                      ~13     !0, ~12
         11        IS_NOT_IDENTICAL                                         ~11, ~13
         12      > JMPZ                                                     ~14, ->16
   11    13    >   FETCH_CONSTANT                                   ~15     'i'
         14        FETCH_DIM_R                                      ~16     !0, ~15
         15        ASSIGN                                                   !2, ~16
    9    16    >   PRE_INC                                                  !3
         17    >   COUNT                                            ~19     !0
         18        IS_SMALLER                                               ~19, !3
         19      > JMPNZ                                                    ~20, ->7
   15    20    >   INIT_FCALL                                               'print_r'
         21        SEND_VAR                                                 !2
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.07 ms | 940 KiB | 16 Q