3v4l.org

run code in 300+ PHP versions simultaneously
<?php $len = readline('Insert lenght of the array' . PHP_EOL); $arr = []; $mid = $len / 2; for ($i = 0; $i < $len; $i++) { $arr[] = readline('Insert number' . PHP_EOL); if ($len % 2 !== 0 && $arr[ceil($mid) + 1] == [ceil($mid) + 1] ) { $ismirror = true; }elseif ($len % 2 == 0 && $arr[$mid] == $arr[$mid +1] && $arr[$mid - 1] == $arr[$mid + 2]){ $ismirror = true; } } echo $ismirror ? 'Yes' : 'No';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 50
Branch analysis from position: 50
2 jumps found. (Code = 44) Position 1 = 52, Position 2 = 9
Branch analysis from position: 52
2 jumps found. (Code = 43) Position 1 = 53, Position 2 = 55
Branch analysis from position: 53
1 jumps found. (Code = 42) Position 1 = 56
Branch analysis from position: 56
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 55
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 46) Position 1 = 17, Position 2 = 29
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 32
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
2 jumps found. (Code = 44) Position 1 = 52, Position 2 = 9
Branch analysis from position: 52
Branch analysis from position: 9
Branch analysis from position: 32
2 jumps found. (Code = 46) Position 1 = 35, Position 2 = 40
Branch analysis from position: 35
2 jumps found. (Code = 46) Position 1 = 41, Position 2 = 47
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 48, Position 2 = 49
Branch analysis from position: 48
2 jumps found. (Code = 44) Position 1 = 52, Position 2 = 9
Branch analysis from position: 52
Branch analysis from position: 9
Branch analysis from position: 49
Branch analysis from position: 47
Branch analysis from position: 40
Branch analysis from position: 29
filename:       /in/5gKv4
function name:  (null)
number of ops:  58
compiled vars:  !0 = $len, !1 = $arr, !2 = $mid, !3 = $i, !4 = $ismirror
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL_BY_NAME                                       'readline'
          1        SEND_VAL_EX                                              'Insert+lenght+of+the+array%0A'
          2        DO_FCALL                                      0  $5      
          3        ASSIGN                                                   !0, $5
    5     4        ASSIGN                                                   !1, <array>
    8     5        DIV                                              ~8      !0, 2
          6        ASSIGN                                                   !2, ~8
    9     7        ASSIGN                                                   !3, 0
          8      > JMP                                                      ->50
   10     9    >   INIT_FCALL_BY_NAME                                       'readline'
         10        SEND_VAL_EX                                              'Insert+number%0A'
         11        DO_FCALL                                      0  $12     
         12        ASSIGN_DIM                                               !1
         13        OP_DATA                                                  $12
   11    14        MOD                                              ~13     !0, 2
         15        IS_NOT_IDENTICAL                                 ~14     ~13, 0
         16      > JMPZ_EX                                          ~14     ~14, ->29
         17    >   INIT_FCALL                                               'ceil'
         18        SEND_VAR                                                 !2
         19        DO_ICALL                                         $15     
         20        ADD                                              ~16     $15, 1
         21        FETCH_DIM_R                                      ~17     !1, ~16
         22        INIT_FCALL                                               'ceil'
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                         $18     
         25        ADD                                              ~19     $18, 1
         26        INIT_ARRAY                                       ~20     ~19
         27        IS_EQUAL                                         ~21     ~17, ~20
         28        BOOL                                             ~14     ~21
         29    > > JMPZ                                                     ~14, ->32
   12    30    >   ASSIGN                                                   !4, <true>
         31      > JMP                                                      ->49
   13    32    >   MOD                                              ~23     !0, 2
         33        IS_EQUAL                                         ~24     ~23, 0
         34      > JMPZ_EX                                          ~24     ~24, ->40
         35    >   FETCH_DIM_R                                      ~25     !1, !2
         36        ADD                                              ~26     !2, 1
         37        FETCH_DIM_R                                      ~27     !1, ~26
         38        IS_EQUAL                                         ~28     ~25, ~27
         39        BOOL                                             ~24     ~28
         40    > > JMPZ_EX                                          ~24     ~24, ->47
         41    >   SUB                                              ~29     !2, 1
         42        FETCH_DIM_R                                      ~30     !1, ~29
         43        ADD                                              ~31     !2, 2
         44        FETCH_DIM_R                                      ~32     !1, ~31
         45        IS_EQUAL                                         ~33     ~30, ~32
         46        BOOL                                             ~24     ~33
         47    > > JMPZ                                                     ~24, ->49
   14    48    >   ASSIGN                                                   !4, <true>
    9    49    >   PRE_INC                                                  !3
         50    >   IS_SMALLER                                               !3, !0
         51      > JMPNZ                                                    ~36, ->9
   18    52    > > JMPZ                                                     !4, ->55
         53    >   QM_ASSIGN                                        ~37     'Yes'
         54      > JMP                                                      ->56
         55    >   QM_ASSIGN                                        ~37     'No'
         56    >   ECHO                                                     ~37
         57      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
179.38 ms | 1400 KiB | 15 Q