3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "racecar"; $pal = ""; for($a=0; $a<strlen($str); $a++) { for($z=0; $z<strlen($str); $z++) { $subs = substr($str, $a, $z); if( $subs == strrev($subs) and strlen($subs) > strlen($pal) ) { echo $a; echo $z; $pal = $subs; } } } echo $pal;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 4
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 6
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 4
Branch analysis from position: 33
Branch analysis from position: 4
Branch analysis from position: 6
2 jumps found. (Code = 46) Position 1 = 17, Position 2 = 21
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 22, Position 2 = 25
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 6
Branch analysis from position: 29
Branch analysis from position: 6
Branch analysis from position: 25
Branch analysis from position: 21
filename:       /in/Sj6l3
function name:  (null)
number of ops:  35
compiled vars:  !0 = $str, !1 = $pal, !2 = $a, !3 = $z, !4 = $subs
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'racecar'
    4     1        ASSIGN                                                   !1, ''
    7     2        ASSIGN                                                   !2, 0
          3      > JMP                                                      ->30
    9     4    >   ASSIGN                                                   !3, 0
          5      > JMP                                                      ->26
   10     6    >   INIT_FCALL                                               'substr'
          7        SEND_VAR                                                 !0
          8        SEND_VAR                                                 !2
          9        SEND_VAR                                                 !3
         10        DO_ICALL                                         $9      
         11        ASSIGN                                                   !4, $9
   11    12        INIT_FCALL                                               'strrev'
         13        SEND_VAR                                                 !4
         14        DO_ICALL                                         $11     
         15        IS_EQUAL                                         ~12     !4, $11
         16      > JMPZ_EX                                          ~12     ~12, ->21
         17    >   STRLEN                                           ~13     !4
         18        STRLEN                                           ~14     !1
         19        IS_SMALLER                                       ~15     ~14, ~13
         20        BOOL                                             ~12     ~15
         21    > > JMPZ                                                     ~12, ->25
   12    22    >   ECHO                                                     !2
   13    23        ECHO                                                     !3
   14    24        ASSIGN                                                   !1, !4
    9    25    >   PRE_INC                                                  !3
         26    >   STRLEN                                           ~18     !0
         27        IS_SMALLER                                               !3, ~18
         28      > JMPNZ                                                    ~19, ->6
    7    29    >   PRE_INC                                                  !2
         30    >   STRLEN                                           ~21     !0
         31        IS_SMALLER                                               !2, ~21
         32      > JMPNZ                                                    ~22, ->4
   20    33    >   ECHO                                                     !1
         34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.51 ms | 1400 KiB | 17 Q