3v4l.org

run code in 500+ 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:/in/p6skg:4}
number of ops:  11
compiled vars:  !0 = $m
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
    5     1        FETCH_DIM_R                                          ~1      !0, 2
          2        FRAMELESS_ICALL_3                str_replace         ~2      '+', ''
          3        OP_DATA                                                      ~1
          4        CONCAT                                               ~3      '%3Ca+href%3D%22', ~2
          5        CONCAT                                               ~4      ~3, '%22%3E'
          6        FETCH_DIM_R                                          ~5      !0, 1
          7        CONCAT                                               ~6      ~4, ~5
          8        CONCAT                                               ~7      ~6, '%3C%2Fa%3E'
          9      > RETURN                                                       ~7
    6    10*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
163.34 ms | 2019 KiB | 14 Q