3v4l.org

run code in 300+ PHP versions simultaneously
<?php $haystack = 'this is a school'; $pattern = 'sch'; $match = strstr($haystack, $pattern); $result = strlen($match) - strlen($pattern); echo $result; ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/UiWtq
function name:  (null)
number of ops:  13
compiled vars:  !0 = $haystack, !1 = $pattern, !2 = $match, !3 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'this+is+a+school'
    3     1        ASSIGN                                                   !1, 'sch'
    5     2        INIT_FCALL                                               'strstr'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !2, $6
    6     7        STRLEN                                           ~8      !2
          8        STRLEN                                           ~9      !1
          9        SUB                                              ~10     ~8, ~9
         10        ASSIGN                                                   !3, ~10
    7    11        ECHO                                                     !3
    8    12      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.9 ms | 1394 KiB | 15 Q