3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string='produk_kemeja'; $pos=0; $count=0; while(($pos = strpos($string, 'produk_')) !== FALSE){ $count++; // This ends } echo $count;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 5
Branch analysis from position: 5
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 4
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 4
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 4
Branch analysis from position: 12
Branch analysis from position: 4
filename:       /in/nUW6G
function name:  (null)
number of ops:  14
compiled vars:  !0 = $string, !1 = $pos, !2 = $count
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'produk_kemeja'
    3     1        ASSIGN                                                   !1, 0
    4     2        ASSIGN                                                   !2, 0
    5     3      > JMP                                                      ->5
    7     4    >   PRE_INC                                                  !2
    5     5    >   INIT_FCALL                                               'strpos'
          6        SEND_VAR                                                 !0
          7        SEND_VAL                                                 'produk_'
          8        DO_ICALL                                         $7      
          9        ASSIGN                                           ~8      !1, $7
         10        TYPE_CHECK                                  1018          ~8
         11      > JMPNZ                                                    ~9, ->4
   10    12    >   ECHO                                                     !2
         13      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.86 ms | 1394 KiB | 15 Q