3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str[] = "01C8000100023543900000133243"; $str[] = "01C80010023543xxxxxxx243"; $str[] = "1543344=-23-1--923243"; $pattern = "/3543(.+)3243/"; foreach($str as $key=>$string) { if(preg_match($pattern,$string,$res)) { echo "found in $string: ".$res[1]." starts at position ".strpos($string,$res[1])."\r\n"; } else { echo "not found in $string"."\r\n"; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 36
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 36
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 31
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 36
filename:       /in/qGrQO
function name:  (null)
number of ops:  38
compiled vars:  !0 = $str, !1 = $pattern, !2 = $string, !3 = $key, !4 = $res
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN_DIM                                               !0
          1        OP_DATA                                                  '01C8000100023543900000133243'
    4     2        ASSIGN_DIM                                               !0
          3        OP_DATA                                                  '01C80010023543xxxxxxx243'
    5     4        ASSIGN_DIM                                               !0
          5        OP_DATA                                                  '1543344%3D-23-1--923243'
    7     6        ASSIGN                                                   !1, '%2F3543%28.%2B%293243%2F'
    9     7      > FE_RESET_R                                       $9      !0, ->36
          8    > > FE_FETCH_R                                       ~10     $9, !2, ->36
          9    >   ASSIGN                                                   !3, ~10
   10    10        INIT_FCALL                                               'preg_match'
         11        SEND_VAR                                                 !1
         12        SEND_VAR                                                 !2
         13        SEND_REF                                                 !4
         14        DO_ICALL                                         $12     
         15      > JMPZ                                                     $12, ->31
   11    16    >   ROPE_INIT                                     3  ~14     'found+in+'
         17        ROPE_ADD                                      1  ~14     ~14, !2
         18        ROPE_END                                      2  ~13     ~14, '%3A+'
         19        FETCH_DIM_R                                      ~16     !4, 1
         20        CONCAT                                           ~17     ~13, ~16
         21        CONCAT                                           ~18     ~17, '+starts+at+position+'
         22        INIT_FCALL                                               'strpos'
         23        SEND_VAR                                                 !2
         24        FETCH_DIM_R                                      ~19     !4, 1
         25        SEND_VAL                                                 ~19
         26        DO_ICALL                                         $20     
         27        CONCAT                                           ~21     ~18, $20
         28        CONCAT                                           ~22     ~21, '%0D%0A'
         29        ECHO                                                     ~22
         30      > JMP                                                      ->35
   14    31    >   NOP                                                      
         32        FAST_CONCAT                                      ~23     'not+found+in+', !2
         33        CONCAT                                           ~24     ~23, '%0D%0A'
         34        ECHO                                                     ~24
    9    35    > > JMP                                                      ->8
         36    >   FE_FREE                                                  $9
   16    37      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.75 ms | 1400 KiB | 17 Q