3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.07 ms | 1395 KiB | 19 Q