3v4l.org

run code in 300+ PHP versions simultaneously
<?php $search = preg_quote('test'); $extra_words = 3; $pattern = '#([^ ]+ ){0,'.$extra_words.'}'.$search.'( [^ ]+){0,'.$extra_words.'}#'; $res = preg_match_all($pattern,'some more text 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/dRNdW
function name:  (null)
number of ops:  22
compiled vars:  !0 = $search, !1 = $extra_words, !2 = $pattern, !3 = $res, !4 = $regs
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'preg_quote'
          1        SEND_VAL                                                 'test'
          2        DO_ICALL                                         $5      
          3        ASSIGN                                                   !0, $5
    5     4        ASSIGN                                                   !1, 3
    6     5        CONCAT                                           ~8      '%23%28%5B%5E+%5D%2B+%29%7B0%2C', !1
          6        CONCAT                                           ~9      ~8, '%7D'
          7        CONCAT                                           ~10     ~9, !0
          8        CONCAT                                           ~11     ~10, '%28+%5B%5E+%5D%2B%29%7B0%2C'
          9        CONCAT                                           ~12     ~11, !1
         10        CONCAT                                           ~13     ~12, '%7D%23'
         11        ASSIGN                                                   !2, ~13
    9    12        INIT_FCALL                                               'preg_match_all'
         13        SEND_VAR                                                 !2
         14        SEND_VAL                                                 'some+more+text+write+your+test+data+found+more+than+once+test+here+'
         15        SEND_REF                                                 !4
         16        DO_ICALL                                         $15     
         17        ASSIGN                                                   !3, $15
   10    18        INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !4
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.49 ms | 1395 KiB | 19 Q