3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = '[My Test URL|https://ww w.mywebsite.c om/t est?param=123]'; echo preg_replace_callback('/\[([^][|]*)\|([^][]+)]/', function($m) { return '<a href="' . str_replace(' ', '', $m[2]) . '">' . $m[1] . '</a>'; }, $text);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/p6skg
function name:  (null)
number of ops:  9
compiled vars:  !0 = $text
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%5BMy+Test+URL%7Chttps%3A%2F%2Fww+w.mywebsite.c+om%2Ft++est%3Fparam%3D123%5D'
    4     1        INIT_FCALL                                               'preg_replace_callback'
          2        SEND_VAL                                                 '%2F%5C%5B%28%5B%5E%5D%5B%7C%5D%2A%29%5C%7C%28%5B%5E%5D%5B%5D%2B%29%5D%2F'
          3        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
    6     4        SEND_VAL                                                 ~2
          5        SEND_VAR                                                 !0
    4     6        DO_ICALL                                         $3      
    6     7        ECHO                                                     $3
          8      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/p6skg
function name:  {closure}
number of ops:  14
compiled vars:  !0 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'str_replace'
          2        SEND_VAL                                                 '+'
          3        SEND_VAL                                                 ''
          4        FETCH_DIM_R                                      ~1      !0, 2
          5        SEND_VAL                                                 ~1
          6        DO_ICALL                                         $2      
          7        CONCAT                                           ~3      '%3Ca+href%3D%22', $2
          8        CONCAT                                           ~4      ~3, '%22%3E'
          9        FETCH_DIM_R                                      ~5      !0, 1
         10        CONCAT                                           ~6      ~4, ~5
         11        CONCAT                                           ~7      ~6, '%3C%2Fa%3E'
         12      > RETURN                                                   ~7
    6    13*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.79 ms | 1011 KiB | 15 Q