3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "racecar"; $pal = ""; echo substr($str, 0, 7); 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) ) { $pal = $subs; } } } echo $pal;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 10
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 12
Branch analysis from position: 33
2 jumps found. (Code = 44) Position 1 = 37, Position 2 = 10
Branch analysis from position: 37
Branch analysis from position: 10
Branch analysis from position: 12
2 jumps found. (Code = 46) Position 1 = 23, Position 2 = 27
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 29
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 12
Branch analysis from position: 33
Branch analysis from position: 12
Branch analysis from position: 29
Branch analysis from position: 27
filename:       /in/XOuCr
function name:  (null)
number of ops:  39
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, ''
    5     2        INIT_FCALL                                               'substr'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 0
          5        SEND_VAL                                                 7
          6        DO_ICALL                                         $7      
          7        ECHO                                                     $7
    7     8        ASSIGN                                                   !2, 0
          9      > JMP                                                      ->34
    9    10    >   ASSIGN                                                   !3, 0
         11      > JMP                                                      ->30
   10    12    >   INIT_FCALL                                               'substr'
         13        SEND_VAR                                                 !0
         14        SEND_VAR                                                 !2
         15        SEND_VAR                                                 !3
         16        DO_ICALL                                         $10     
         17        ASSIGN                                                   !4, $10
   11    18        INIT_FCALL                                               'strrev'
         19        SEND_VAR                                                 !4
         20        DO_ICALL                                         $12     
         21        IS_EQUAL                                         ~13     !4, $12
         22      > JMPZ_EX                                          ~13     ~13, ->27
         23    >   STRLEN                                           ~14     !4
         24        STRLEN                                           ~15     !1
         25        IS_SMALLER                                       ~16     ~15, ~14
         26        BOOL                                             ~13     ~16
         27    > > JMPZ                                                     ~13, ->29
   13    28    >   ASSIGN                                                   !1, !4
    9    29    >   PRE_INC                                                  !3
         30    >   STRLEN                                           ~19     !0
         31        IS_SMALLER                                               !3, ~19
         32      > JMPNZ                                                    ~20, ->12
    7    33    >   PRE_INC                                                  !2
         34    >   STRLEN                                           ~22     !0
         35        IS_SMALLER                                               !2, ~22
         36      > JMPNZ                                                    ~23, ->10
   19    37    >   ECHO                                                     !1
         38      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.87 ms | 1400 KiB | 17 Q