3v4l.org

run code in 300+ PHP versions simultaneously
<?php $search = preg_quote('test'); $pattern = '#([^ ]+ ){0,10}'.$search.'( [^ ]+){0,10}#'; $res = preg_match_all($pattern,'write your test data here',$regs); var_dump($regs); $res = preg_match_all($pattern,'test data here',$regs); var_dump($regs); $res = preg_match_all($pattern,'write your test',$regs); var_dump($regs); $res = preg_match_all($pattern,'not found at all',$regs); var_dump($regs); $res = preg_match_all($pattern,'write your test data found more than once test here ',$regs); var_dump($regs);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QltdJ
function name:  (null)
number of ops:  53
compiled vars:  !0 = $search, !1 = $pattern, !2 = $res, !3 = $regs
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'preg_quote'
          1        SEND_VAL                                                 'test'
          2        DO_ICALL                                         $4      
          3        ASSIGN                                                   !0, $4
    5     4        CONCAT                                           ~6      '%23%28%5B%5E+%5D%2B+%29%7B0%2C10%7D', !0
          5        CONCAT                                           ~7      ~6, '%28+%5B%5E+%5D%2B%29%7B0%2C10%7D%23'
          6        ASSIGN                                                   !1, ~7
    7     7        INIT_FCALL                                               'preg_match_all'
          8        SEND_VAR                                                 !1
          9        SEND_VAL                                                 'write+your+test+data+here'
         10        SEND_REF                                                 !3
         11        DO_ICALL                                         $9      
         12        ASSIGN                                                   !2, $9
    8    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAR                                                 !3
         15        DO_ICALL                                                 
   10    16        INIT_FCALL                                               'preg_match_all'
         17        SEND_VAR                                                 !1
         18        SEND_VAL                                                 'test+data+here'
         19        SEND_REF                                                 !3
         20        DO_ICALL                                         $12     
         21        ASSIGN                                                   !2, $12
   11    22        INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !3
         24        DO_ICALL                                                 
   13    25        INIT_FCALL                                               'preg_match_all'
         26        SEND_VAR                                                 !1
         27        SEND_VAL                                                 'write+your+test'
         28        SEND_REF                                                 !3
         29        DO_ICALL                                         $15     
         30        ASSIGN                                                   !2, $15
   14    31        INIT_FCALL                                               'var_dump'
         32        SEND_VAR                                                 !3
         33        DO_ICALL                                                 
   16    34        INIT_FCALL                                               'preg_match_all'
         35        SEND_VAR                                                 !1
         36        SEND_VAL                                                 'not+found+at+all'
         37        SEND_REF                                                 !3
         38        DO_ICALL                                         $18     
         39        ASSIGN                                                   !2, $18
   17    40        INIT_FCALL                                               'var_dump'
         41        SEND_VAR                                                 !3
         42        DO_ICALL                                                 
   19    43        INIT_FCALL                                               'preg_match_all'
         44        SEND_VAR                                                 !1
         45        SEND_VAL                                                 'write+your+test+data+found+more+than+once+test+here+'
         46        SEND_REF                                                 !3
         47        DO_ICALL                                         $21     
         48        ASSIGN                                                   !2, $21
   20    49        INIT_FCALL                                               'var_dump'
         50        SEND_VAR                                                 !3
         51        DO_ICALL                                                 
         52      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.15 ms | 1400 KiB | 19 Q