3v4l.org

run code in 300+ PHP versions simultaneously
<?php $subject = "any"; $b = " "; $delimited = "$b$subject$b"; $replace = array("?","*","(",")",",","."); $str = "Will *any* company do *any* job, (are there any)?"; echo "\nThe string: \"$str\""; $temp = str_replace($replace,$b,$str); while ( ($pos = strpos($temp,$delimited)) !== false ) { echo "\nThe subject \"$subject\" occurs at position ",($pos + 1); for ($i=0,$max=$pos + 1 + strlen($subject); $i <= $max; $i++) { $temp[$i] = $b; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
2 jumps found. (Code = 44) Position 1 = 43, Position 2 = 19
Branch analysis from position: 43
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 34
Branch analysis from position: 34
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 31
Branch analysis from position: 36
Branch analysis from position: 31
2 jumps found. (Code = 44) Position 1 = 36, Position 2 = 31
Branch analysis from position: 36
Branch analysis from position: 31
filename:       /in/IiVYk
function name:  (null)
number of ops:  44
compiled vars:  !0 = $subject, !1 = $b, !2 = $delimited, !3 = $replace, !4 = $str, !5 = $temp, !6 = $pos, !7 = $i, !8 = $max
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'any'
    3     1        ASSIGN                                                   !1, '+'
    4     2        ROPE_INIT                                     3  ~12     !1
          3        ROPE_ADD                                      1  ~12     ~12, !0
          4        ROPE_END                                      2  ~11     ~12, !1
          5        ASSIGN                                                   !2, ~11
    6     6        ASSIGN                                                   !3, <array>
    7     7        ASSIGN                                                   !4, 'Will+%2Aany%2A+company+do+%2Aany%2A+job%2C+%28are+there+any%29%3F'
    8     8        ROPE_INIT                                     3  ~18     '%0AThe+string%3A+%22'
          9        ROPE_ADD                                      1  ~18     ~18, !4
         10        ROPE_END                                      2  ~17     ~18, '%22'
         11        ECHO                                                     ~17
   10    12        INIT_FCALL                                               'str_replace'
         13        SEND_VAR                                                 !3
         14        SEND_VAR                                                 !1
         15        SEND_VAR                                                 !4
         16        DO_ICALL                                         $20     
         17        ASSIGN                                                   !5, $20
   11    18      > JMP                                                      ->36
   13    19    >   ROPE_INIT                                     3  ~23     '%0AThe+subject+%22'
         20        ROPE_ADD                                      1  ~23     ~23, !0
         21        ROPE_END                                      2  ~22     ~23, '%22+occurs+at+position+'
         22        ECHO                                                     ~22
         23        ADD                                              ~25     !6, 1
         24        ECHO                                                     ~25
   14    25        ASSIGN                                                   !7, 0
         26        ADD                                              ~27     !6, 1
         27        STRLEN                                           ~28     !0
         28        ADD                                              ~29     ~27, ~28
         29        ASSIGN                                                   !8, ~29
         30      > JMP                                                      ->34
   15    31    >   ASSIGN_DIM                                               !5, !7
         32        OP_DATA                                                  !1
   14    33        PRE_INC                                                  !7
         34    >   IS_SMALLER_OR_EQUAL                                      !7, !8
         35      > JMPNZ                                                    ~33, ->31
   11    36    >   INIT_FCALL                                               'strpos'
         37        SEND_VAR                                                 !5
         38        SEND_VAR                                                 !2
         39        DO_ICALL                                         $34     
         40        ASSIGN                                           ~35     !6, $34
         41        TYPE_CHECK                                  1018          ~35
         42      > JMPNZ                                                    ~36, ->19
   17    43    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.73 ms | 1400 KiB | 17 Q