3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "[url=https://test.com]my link[/url]"; echo preg_replace('~\[url=([^][\s]+)]([^][]*)\[/url]~', "<a href='$1' target='_blank'>$2</a>", $text) . PHP_EOL; echo preg_replace('~\[url=([^][\s]+)](.*?)\[/url]~s', "<a href='$1' target='_blank'>$2</a>", $text);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qtMeO
function name:  (null)
number of ops:  15
compiled vars:  !0 = $text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%5Burl%3Dhttps%3A%2F%2Ftest.com%5Dmy+link%5B%2Furl%5D'
    4     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%7E%5C%5Burl%3D%28%5B%5E%5D%5B%5Cs%5D%2B%29%5D%28%5B%5E%5D%5B%5D%2A%29%5C%5B%2Furl%5D%7E'
          3        SEND_VAL                                                 '%3Ca+href%3D%27%241%27+target%3D%27_blank%27%3E%242%3C%2Fa%3E'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        CONCAT                                           ~3      $2, '%0A'
          7        ECHO                                                     ~3
    5     8        INIT_FCALL                                               'preg_replace'
          9        SEND_VAL                                                 '%7E%5C%5Burl%3D%28%5B%5E%5D%5B%5Cs%5D%2B%29%5D%28.%2A%3F%29%5C%5B%2Furl%5D%7Es'
         10        SEND_VAL                                                 '%3Ca+href%3D%27%241%27+target%3D%27_blank%27%3E%242%3C%2Fa%3E'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                         $4      
         13        ECHO                                                     $4
         14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
126.87 ms | 1399 KiB | 15 Q