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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
209.62 ms | 1396 KiB | 19 Q