3v4l.org

run code in 500+ PHP versions simultaneously
<?php $bb_string = "...du texte [URL]http://developpez.net/[/URL], du texte... [URL]developpez.net/[/URL] du texte... [URL=http://developpez.net/]Un lien[/URL] du texte... [URL=developpez.net/]http://developpez.net/[/URL]"; $bb_string = preg_replace_callback('~\[url (?| = ([^]]*) ] ( [^[]*+ (?:\[(?!/url) [^[]*)*+ ) | ] (( [^[]*+ (?:\[(?!/url) [^[]*)*+ )) ) \[/url]~ix', function ($m) { $url = trim($m[1]); return '<a href="' . ( parse_url($m[1], PHP_URL_SCHEME) ? '' : 'http://') . $m[1] . '" target="_blank">' . trim($m[2]) . '</a>'; }, $bb_string); echo $bb_string;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qcqCL
function name:  (null)
number of ops:  10
compiled vars:  !0 = $bb_string
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '...du+texte+%5BURL%5Dhttp%3A%2F%2Fdeveloppez.net%2F%5B%2FURL%5D%2C+du+texte...+%5BURL%5Ddeveloppez.net%2F%5B%2FURL%5D+du+texte...+%5BURL%3Dhttp%3A%2F%2Fdeveloppez.net%2F%5DUn+lien%5B%2FURL%5D+du+texte...+%5BURL%3Ddeveloppez.net%2F%5Dhttp%3A%2F%2Fdeveloppez.net%2F%5B%2FURL%5D'
    5     1        INIT_FCALL                                                   'preg_replace_callback'
          2        SEND_VAL                                                     '%7E%5C%5Burl%0A++++%28%3F%7C%0A++++++++%3D+%28%5B%5E%5D%5D%2A%29+%5D+%28+%5B%5E%5B%5D%2A%2B+%28%3F%3A%5C%5B%28%3F%21%2Furl%29+%5B%5E%5B%5D%2A%29%2A%2B+%29%0A++++++%7C%0A++++++++%5D+%28%28+%5B%5E%5B%5D%2A%2B+%28%3F%3A%5C%5B%28%3F%21%2Furl%29+%5B%5E%5B%5D%2A%29%2A%2B+%29%29%0A++++%29%0A++++%5C%5B%2Furl%5D%7Eix'
   11     3        DECLARE_LAMBDA_FUNCTION                              ~2      [0]
   15     4        SEND_VAL                                                     ~2
          5        SEND_VAR                                                     !0
    5     6        DO_ICALL                                             $3      
          7        ASSIGN                                                       !0, $3
   17     8        ECHO                                                         !0
          9      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qcqCL
function name:  {closure:/in/qcqCL:11}
number of ops:  23
compiled vars:  !0 = $m, !1 = $url
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   RECV                                                 !0      
   12     1        FETCH_DIM_R                                          ~2      !0, 1
          2        FRAMELESS_ICALL_1                trim                ~3      ~2
          3        ASSIGN                                                       !1, ~3
   13     4        INIT_FCALL                                                   'parse_url'
          5        FETCH_DIM_R                                          ~5      !0, 1
          6        SEND_VAL                                                     ~5
          7        SEND_VAL                                                     0
          8        DO_ICALL                                             $6      
          9      > JMPZ                                                         $6, ->12
         10    >   QM_ASSIGN                                            ~7      ''
         11      > JMP                                                          ->13
         12    >   QM_ASSIGN                                            ~7      'http%3A%2F%2F'
         13    >   CONCAT                                               ~8      '%3Ca+href%3D%22', ~7
   14    14        FETCH_DIM_R                                          ~9      !0, 1
         15        CONCAT                                               ~10     ~8, ~9
         16        CONCAT                                               ~11     ~10, '%22+target%3D%22_blank%22%3E'
         17        FETCH_DIM_R                                          ~12     !0, 2
         18        FRAMELESS_ICALL_1                trim                ~13     ~12
         19        CONCAT                                               ~14     ~11, ~13
         20        CONCAT                                               ~15     ~14, '%3C%2Fa%3E'
         21      > RETURN                                                       ~15
   15    22*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.74 ms | 2264 KiB | 15 Q