3v4l.org

run code in 300+ PHP versions simultaneously
<?php function IsCasiPalindromo($str){ $count = 0; $idx1 = 0; $idx2 = strlen($str)-1; while($idx1 <= $idx2){ if($str[$idx1] != $str[$idx2]){ $count++; return false; } $idx1++; $idx2--; } return true; } echo IsCasiPalindromo("abccba") . '<br>'; echo IsCasiPalindromo("abccbx") . '<br>'; echo IsCasiPalindromo("abccfg") . '<br>';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/K0PEU
function name:  (null)
number of ops:  16
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   INIT_FCALL                                               'iscasipalindromo'
          1        SEND_VAL                                                 'abccba'
          2        DO_FCALL                                      0  $0      
          3        CONCAT                                           ~1      $0, '%3Cbr%3E'
          4        ECHO                                                     ~1
   19     5        INIT_FCALL                                               'iscasipalindromo'
          6        SEND_VAL                                                 'abccbx'
          7        DO_FCALL                                      0  $2      
          8        CONCAT                                           ~3      $2, '%3Cbr%3E'
          9        ECHO                                                     ~3
   20    10        INIT_FCALL                                               'iscasipalindromo'
         11        SEND_VAL                                                 'abccfg'
         12        DO_FCALL                                      0  $4      
         13        CONCAT                                           ~5      $4, '%3Cbr%3E'
         14        ECHO                                                     ~5
         15      > RETURN                                                   1

Function iscasipalindromo:
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 = 17, Position 2 = 7
Branch analysis from position: 17
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
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 17, Position 2 = 7
Branch analysis from position: 17
Branch analysis from position: 7
filename:       /in/K0PEU
function name:  IsCasiPalindromo
number of ops:  19
compiled vars:  !0 = $str, !1 = $count, !2 = $idx1, !3 = $idx2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        ASSIGN                                                   !1, 0
    5     2        ASSIGN                                                   !2, 0
    6     3        STRLEN                                           ~6      !0
          4        SUB                                              ~7      ~6, 1
          5        ASSIGN                                                   !3, ~7
    7     6      > JMP                                                      ->15
    8     7    >   FETCH_DIM_R                                      ~9      !0, !2
          8        FETCH_DIM_R                                      ~10     !0, !3
          9        IS_NOT_EQUAL                                             ~9, ~10
         10      > JMPZ                                                     ~11, ->13
    9    11    >   PRE_INC                                                  !1
   10    12      > RETURN                                                   <false>
   12    13    >   PRE_INC                                                  !2
   13    14        PRE_DEC                                                  !3
    7    15    >   IS_SMALLER_OR_EQUAL                                      !2, !3
         16      > JMPNZ                                                    ~15, ->7
   15    17    > > RETURN                                                   <true>
   16    18*     > RETURN                                                   null

End of function iscasipalindromo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
183.92 ms | 1402 KiB | 16 Q