3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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) && strlen($subs) > strlen($pal) ) { $pal = $subs; } } echo $pal;
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = 30
Branch analysis from position: 30
Jump found. Position 1 = 33, Position 2 = 4
Branch analysis from position: 33
Jump found. Position 1 = -2
Branch analysis from position: 4
Jump found. Position 1 = 14
Branch analysis from position: 14
Jump found. Position 1 = 17, Position 2 = 6
Branch analysis from position: 17
Jump found. Position 1 = 22, Position 2 = 26
Branch analysis from position: 22
Jump found. Position 1 = 27, Position 2 = 28
Branch analysis from position: 27
Jump found. Position 1 = 33, Position 2 = 4
Branch analysis from position: 33
Branch analysis from position: 4
Branch analysis from position: 28
Branch analysis from position: 26
Branch analysis from position: 6
Jump found. Position 1 = 17, Position 2 = 6
Branch analysis from position: 17
Branch analysis from position: 6
filename:       /in/bG7Jh
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, ''
   6     2        ASSIGN                                                   !2, 0
         3      > JMP                                                      ->30
   9     4    >   ASSIGN                                                   !3, 0
         5      > JMP                                                      ->14
  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
   9    12        POST_INC                                         ~11     !3
        13        FREE                                                     ~11
        14    >   STRLEN                                           ~12     !0
        15        IS_SMALLER                                       ~13     !3, ~12
        16      > JMPNZ                                                    ~13, ->6
  11    17    >   INIT_FCALL                                               'strrev'
        18        SEND_VAR                                                 !4
        19        DO_ICALL                                         $14     
        20        IS_EQUAL                                         ~15     !4, $14
        21      > JMPZ_EX                                          ~15     ~15, ->26
        22    >   STRLEN                                           ~16     !4
        23        STRLEN                                           ~17     !1
        24        IS_SMALLER                                       ~18     ~17, ~16
        25        BOOL                                             ~15     ~18
        26    > > JMPZ                                                     ~15, ->28
  12    27    >   ASSIGN                                                   !1, !4
   6    28    >   POST_INC                                         ~20     !2
        29        FREE                                                     ~20
        30    >   STRLEN                                           ~21     !0
        31        IS_SMALLER                                       ~22     !2, ~21
        32      > JMPNZ                                                    ~22, ->4
  17    33    >   ECHO                                                     !1
        34      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.2.0