3v4l.org

run code in 300+ PHP versions simultaneously
<?php function solution($S) { $length = strlen($S); if ($length == 0) { return false; } elseif ($length == 1) { return true; } else { for ( $i=0; $i < strlen($S); $i++) { if (substr($S, $i, 1) == substr($S, $length - $i, 1)) { continue; } else { return false; } } } return true; } echo solution('anavolimilovana'); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8sBfk
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   24     0  E >   INIT_FCALL                                               'solution'
          1        SEND_VAL                                                 'anavolimilovana'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
   25     4      > RETURN                                                   1

Function solution:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 5, Position 2 = 7
Branch analysis from position: 5
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 13
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 26, Position 2 = 28
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 13
Branch analysis from position: 33
Branch analysis from position: 13
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8sBfk
function name:  solution
number of ops:  35
compiled vars:  !0 = $S, !1 = $length, !2 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    4     1        STRLEN                                           ~3      !0
          2        ASSIGN                                                   !1, ~3
    6     3        IS_EQUAL                                                 !1, 0
          4      > JMPZ                                                     ~5, ->7
    7     5    > > RETURN                                                   <false>
          6*       JMP                                                      ->33
    8     7    >   IS_EQUAL                                                 !1, 1
          8      > JMPZ                                                     ~6, ->11
    9     9    > > RETURN                                                   <true>
         10*       JMP                                                      ->33
   11    11    >   ASSIGN                                                   !2, 0
         12      > JMP                                                      ->30
   13    13    >   INIT_FCALL                                               'substr'
         14        SEND_VAR                                                 !0
         15        SEND_VAR                                                 !2
         16        SEND_VAL                                                 1
         17        DO_ICALL                                         $8      
         18        INIT_FCALL                                               'substr'
         19        SEND_VAR                                                 !0
         20        SUB                                              ~9      !1, !2
         21        SEND_VAL                                                 ~9
         22        SEND_VAL                                                 1
         23        DO_ICALL                                         $10     
         24        IS_EQUAL                                                 $8, $10
         25      > JMPZ                                                     ~11, ->28
   14    26    > > JMP                                                      ->29
         27*       JMP                                                      ->29
   16    28    > > RETURN                                                   <false>
   11    29    >   PRE_INC                                                  !2
         30    >   STRLEN                                           ~13     !0
         31        IS_SMALLER                                               !2, ~13
         32      > JMPNZ                                                    ~14, ->13
   21    33    > > RETURN                                                   <true>
   22    34*     > RETURN                                                   null

End of function solution

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.28 ms | 1402 KiB | 16 Q