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++) { //echo $a[i] ." ". $a[$j]; if ($a[$i] !== $a[$j]) { $output = $a[$i]; } $j--; } print_r($output);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 7
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 7
Branch analysis from position: 18
Branch analysis from position: 7
Branch analysis from position: 13
filename:       /in/M4Pfa
function name:  (null)
number of ops:  22
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                                                      ->15
   11     7    >   FETCH_DIM_R                                      ~10     !0, !3
          8        FETCH_DIM_R                                      ~11     !0, !1
          9        IS_NOT_IDENTICAL                                         ~10, ~11
         10      > JMPZ                                                     ~12, ->13
   12    11    >   FETCH_DIM_R                                      ~13     !0, !3
         12        ASSIGN                                                   !2, ~13
   15    13    >   PRE_DEC                                                  !1
    9    14        PRE_INC                                                  !3
         15    >   COUNT                                            ~17     !0
         16        IS_SMALLER                                               ~17, !3
         17      > JMPNZ                                                    ~18, ->7
   18    18    >   INIT_FCALL                                               'print_r'
         19        SEND_VAR                                                 !2
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
14.8 ms | 411 KiB | 7 Q