3v4l.org

run code in 300+ PHP versions simultaneously
<?php $n1 = 'queryselector'; $n2 = 'que'; // echo $n1, $n2; if (strpos($n1,$n2) !== '') { if (strlen($n2) > 0) { echo 'Find substring at position: ' . strpos($n1, $n2); if (substr($n1, 0, strlen($n2)) == $n2) { echo ' & is at Starting.'; } else if (substr($n1, '-'.strlen($n2)) == $n2) { echo ' & is at Ending.'; } else { echo ' & is in Between.'; } } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 38
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 38
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 27
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 35, Position 2 = 37
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
Branch analysis from position: 37
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
Branch analysis from position: 38
filename:       /in/hoET8
function name:  (null)
number of ops:  39
compiled vars:  !0 = $n1, !1 = $n2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'queryselector'
    3     1        ASSIGN                                                   !1, 'que'
    5     2        INIT_FCALL                                               'strpos'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $4      
          6        IS_NOT_IDENTICAL                                         $4, ''
          7      > JMPZ                                                     ~5, ->38
    6     8    >   STRLEN                                           ~6      !1
          9        IS_SMALLER                                               0, ~6
         10      > JMPZ                                                     ~7, ->38
    7    11    >   INIT_FCALL                                               'strpos'
         12        SEND_VAR                                                 !0
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                         $8      
         15        CONCAT                                           ~9      'Find+substring+at+position%3A+', $8
         16        ECHO                                                     ~9
    8    17        INIT_FCALL                                               'substr'
         18        SEND_VAR                                                 !0
         19        SEND_VAL                                                 0
         20        STRLEN                                           ~10     !1
         21        SEND_VAL                                                 ~10
         22        DO_ICALL                                         $11     
         23        IS_EQUAL                                                 !1, $11
         24      > JMPZ                                                     ~12, ->27
    9    25    >   ECHO                                                     '+%26+is+at+Starting.'
    8    26      > JMP                                                      ->38
   10    27    >   INIT_FCALL                                               'substr'
         28        SEND_VAR                                                 !0
         29        STRLEN                                           ~13     !1
         30        CONCAT                                           ~14     '-', ~13
         31        SEND_VAL                                                 ~14
         32        DO_ICALL                                         $15     
         33        IS_EQUAL                                                 !1, $15
         34      > JMPZ                                                     ~16, ->37
   11    35    >   ECHO                                                     '+%26+is+at+Ending.'
   10    36      > JMP                                                      ->38
   13    37    >   ECHO                                                     '+%26+is+in+Between.'
   16    38    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.63 ms | 1016 KiB | 15 Q