3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '/(.*?)(\[\w{3}=\')(\w+\.\w+)(\'\])(.*?)(\[\w{3}=\')(\w+\.\w+).*/s'; $str = 'Hello, view this pdf [PDF=\'hello.pdf\'] and then view this PDF [PDF=\'goodmorning.pdf\']'; $subst = '$0'; $result = preg_replace($re, $subst, $str); echo $result;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6rL1e
function name:  (null)
number of ops:  11
compiled vars:  !0 = $re, !1 = $str, !2 = $subst, !3 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2F%28.%2A%3F%29%28%5C%5B%5Cw%7B3%7D%3D%27%29%28%5Cw%2B%5C.%5Cw%2B%29%28%27%5C%5D%29%28.%2A%3F%29%28%5C%5B%5Cw%7B3%7D%3D%27%29%28%5Cw%2B%5C.%5Cw%2B%29.%2A%2Fs'
    5     1        ASSIGN                                                   !1, 'Hello%2C+view+this+pdf+%5BPDF%3D%27hello.pdf%27%5D+%0A++++and+then+view+this+PDF+%5BPDF%3D%27goodmorning.pdf%27%5D'
    9     2        ASSIGN                                                   !2, '%240'
   11     3        INIT_FCALL                                               'preg_replace'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !2
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                         $7      
          8        ASSIGN                                                   !3, $7
   13     9        ECHO                                                     !3
         10      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.47 ms | 1394 KiB | 15 Q