3v4l.org

run code in 300+ PHP versions simultaneously
<?php $haystack = 'this is a verygood school of sachin'; $pattern = 'sch'; echo '<html><body>'; for ($i = strlen($haystack); $i > 0; $i--) { echo $i . ' '; } echo '<br>'; for ($i = 0; $i < strlen($haystack); $i++) { echo $haystack[$i] . ' '; } echo '</body></html>'; $match = strstr($haystack, $pattern); $result = strlen($match) - strlen($pattern); echo $result; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 6
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 14
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 21, Position 2 = 14
Branch analysis from position: 21
Branch analysis from position: 14
Branch analysis from position: 6
2 jumps found. (Code = 44) Position 1 = 11, Position 2 = 6
Branch analysis from position: 11
Branch analysis from position: 6
filename:       /in/6SHnF
function name:  (null)
number of ops:  33
compiled vars:  !0 = $haystack, !1 = $pattern, !2 = $i, !3 = $match, !4 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'this+is+a+verygood+school+of+sachin'
    3     1        ASSIGN                                                   !1, 'sch'
    5     2        ECHO                                                     '%3Chtml%3E%3Cbody%3E'
    7     3        STRLEN                                           ~7      !0
          4        ASSIGN                                                   !2, ~7
          5      > JMP                                                      ->9
    8     6    >   CONCAT                                           ~9      !2, '+'
          7        ECHO                                                     ~9
    7     8        PRE_DEC                                                  !2
          9    >   IS_SMALLER                                               0, !2
         10      > JMPNZ                                                    ~11, ->6
   11    11    >   ECHO                                                     '%3Cbr%3E'
   13    12        ASSIGN                                                   !2, 0
         13      > JMP                                                      ->18
   14    14    >   FETCH_DIM_R                                      ~13     !0, !2
         15        CONCAT                                           ~14     ~13, '+'
         16        ECHO                                                     ~14
   13    17        PRE_INC                                                  !2
         18    >   STRLEN                                           ~16     !0
         19        IS_SMALLER                                               !2, ~16
         20      > JMPNZ                                                    ~17, ->14
   17    21    >   ECHO                                                     '%3C%2Fbody%3E%3C%2Fhtml%3E'
   19    22        INIT_FCALL                                               'strstr'
         23        SEND_VAR                                                 !0
         24        SEND_VAR                                                 !1
         25        DO_ICALL                                         $18     
         26        ASSIGN                                                   !3, $18
   20    27        STRLEN                                           ~20     !3
         28        STRLEN                                           ~21     !1
         29        SUB                                              ~22     ~20, ~21
         30        ASSIGN                                                   !4, ~22
   21    31        ECHO                                                     !4
   22    32      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.87 ms | 1388 KiB | 15 Q