3v4l.org

run code in 300+ PHP versions simultaneously
<?php $haystack = 'this is a verygood school of sachin'; $pattern = 'sch'; $match = strstr($haystack, $pattern); for ($i = 0;$i < strlen($match);$i++) { if ($match[$i] == ' ') { $match = substr($match, 0, $i); break; } } $result = strlen($match) - strlen($pattern); echo $result; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 9
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 19
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 19
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 9
Branch analysis from position: 23
Branch analysis from position: 9
filename:       /in/fVGUh
function name:  (null)
number of ops:  29
compiled vars:  !0 = $haystack, !1 = $pattern, !2 = $match, !3 = $i, !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        INIT_FCALL                                               'strstr'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $7      
          6        ASSIGN                                                   !2, $7
    7     7        ASSIGN                                                   !3, 0
          8      > JMP                                                      ->20
    8     9    >   FETCH_DIM_R                                      ~10     !2, !3
         10        IS_EQUAL                                                 ~10, '+'
         11      > JMPZ                                                     ~11, ->19
    9    12    >   INIT_FCALL                                               'substr'
         13        SEND_VAR                                                 !2
         14        SEND_VAL                                                 0
         15        SEND_VAR                                                 !3
         16        DO_ICALL                                         $12     
         17        ASSIGN                                                   !2, $12
   10    18      > JMP                                                      ->23
    7    19    >   PRE_INC                                                  !3
         20    >   STRLEN                                           ~15     !2
         21        IS_SMALLER                                               !3, ~15
         22      > JMPNZ                                                    ~16, ->9
   13    23    >   STRLEN                                           ~17     !2
         24        STRLEN                                           ~18     !1
         25        SUB                                              ~19     ~17, ~18
         26        ASSIGN                                                   !4, ~19
   14    27        ECHO                                                     !4
   15    28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.11 ms | 1396 KiB | 17 Q