3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "helloworldfoobar"; $arr = array('stam','world','mamash'); foreach($arr as $item){ if($place = strpos($str,$item)){ echo $place; $str1 = substr($str,$place); } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 17
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 16
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 16
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/VcV9m
function name:  (null)
number of ops:  19
compiled vars:  !0 = $str, !1 = $arr, !2 = $item, !3 = $place, !4 = $str1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'helloworldfoobar'
    4     1        ASSIGN                                                   !1, <array>
    5     2      > FE_RESET_R                                       $7      !1, ->17
          3    > > FE_FETCH_R                                               $7, !2, ->17
    6     4    >   INIT_FCALL                                               'strpos'
          5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !2
          7        DO_ICALL                                         $8      
          8        ASSIGN                                           ~9      !3, $8
          9      > JMPZ                                                     ~9, ->16
    7    10    >   ECHO                                                     !3
    8    11        INIT_FCALL                                               'substr'
         12        SEND_VAR                                                 !0
         13        SEND_VAR                                                 !3
         14        DO_ICALL                                         $10     
         15        ASSIGN                                                   !4, $10
    5    16    > > JMP                                                      ->3
         17    >   FE_FREE                                                  $7
   11    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.71 ms | 1386 KiB | 17 Q