3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strHaystack='test'; $strNeedle='t'; $numPos=strpos($strHaystack,$strNeedle); if(!$numPos or $numpos!=false) print "Found '$strNeedle' at position: $numPos\r\n"; else print "Not Found!\r\n"; ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 47) Position 1 = 9, Position 2 = 11
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 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
filename:       /in/UFt8k
function name:  (null)
number of ops:  21
compiled vars:  !0 = $strHaystack, !1 = $strNeedle, !2 = $numPos, !3 = $numpos
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'test'
    4     1        ASSIGN                                                   !1, 't'
    6     2        INIT_FCALL                                               'strpos'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                         $6      
          6        ASSIGN                                                   !2, $6
    7     7        BOOL_NOT                                         ~8      !2
          8      > JMPNZ_EX                                         ~8      ~8, ->11
          9    >   BOOL                                             ~9      !3
         10        BOOL                                             ~8      ~9
         11    > > JMPZ                                                     ~8, ->19
    8    12    >   ROPE_INIT                                     5  ~11     'Found+%27'
         13        ROPE_ADD                                      1  ~11     ~11, !1
         14        ROPE_ADD                                      2  ~11     ~11, '%27+at+position%3A+'
         15        ROPE_ADD                                      3  ~11     ~11, !2
         16        ROPE_END                                      4  ~10     ~11, '%0D%0A'
         17        ECHO                                                     ~10
         18      > JMP                                                      ->20
    9    19    >   ECHO                                                     'Not+Found%21%0D%0A'
   11    20    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.37 ms | 1387 KiB | 15 Q