3v4l.org

run code in 300+ PHP versions simultaneously
<?php $haystack = 'abcda'; $needle = 'a'; $pos = strpos( $needle,$haystack); if (!$pos) { echo "miss"; } else { echo "hit " . $pos; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HVHN7
function name:  (null)
number of ops:  14
compiled vars:  !0 = $haystack, !1 = $needle, !2 = $pos
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'abcda'
    4     1        ASSIGN                                                   !1, 'a'
    6     2        INIT_FCALL                                               'strpos'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $5      
          6        ASSIGN                                                   !2, $5
    8     7        BOOL_NOT                                         ~7      !2
          8      > JMPZ                                                     ~7, ->11
    9     9    >   ECHO                                                     'miss'
         10      > JMP                                                      ->13
   12    11    >   CONCAT                                           ~8      'hit+', !2
         12        ECHO                                                     ~8
   13    13    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.14 ms | 1386 KiB | 15 Q