3v4l.org

run code in 300+ PHP versions simultaneously
<?php $event = ['categories' => 'meeting;skype']; $needle = 'meeting'; $haystack = $event['categories']; if( ($pos = strpos( $haystack, $needle )) === false){ echo "\n$needle not found in $haystack"; } else { echo "\n$needle exists at position $pos in $haystack"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 17
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kKTJe
function name:  (null)
number of ops:  25
compiled vars:  !0 = $event, !1 = $needle, !2 = $haystack, !3 = $pos
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, 'meeting'
    5     2        FETCH_DIM_R                                      ~6      !0, 'categories'
          3        ASSIGN                                                   !2, ~6
    6     4        INIT_FCALL                                               'strpos'
          5        SEND_VAR                                                 !2
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $8      
          8        ASSIGN                                           ~9      !3, $8
          9        TYPE_CHECK                                    4          ~9
         10      > JMPZ                                                     ~10, ->17
    7    11    >   ROPE_INIT                                     4  ~12     '%0A'
         12        ROPE_ADD                                      1  ~12     ~12, !1
         13        ROPE_ADD                                      2  ~12     ~12, '+not+found+in+'
         14        ROPE_END                                      3  ~11     ~12, !2
         15        ECHO                                                     ~11
    6    16      > JMP                                                      ->24
   11    17    >   ROPE_INIT                                     6  ~15     '%0A'
         18        ROPE_ADD                                      1  ~15     ~15, !1
         19        ROPE_ADD                                      2  ~15     ~15, '+exists+at+position+'
         20        ROPE_ADD                                      3  ~15     ~15, !3
         21        ROPE_ADD                                      4  ~15     ~15, '+in+'
         22        ROPE_END                                      5  ~14     ~15, !2
         23        ECHO                                                     ~14
   12    24    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
139.86 ms | 1067 KiB | 14 Q