3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.36 ms | 1392 KiB | 17 Q