3v4l.org

run code in 300+ PHP versions simultaneously
<?php $message = '<a href="https://www.domain.nl/internet" target="_blank" title="https://www.domain.nl/internet">https://www.domain.nl/internet</a>'; $message = preg_replace_callback('~\shref=[\'"]\Khttps?://www\.domain\.nl(?:/[^\s"\'<>]*)?~i', function($matches) { return 'https://www.affiliatedomain.com/cread.php?id=1234&amp;affid=12345&amp;clickref=me&amp;p=' . urlencode('[[' . $matches[0] . ']]'); }, $message); echo $message; // =%5B%5Bhttps%3A%2F%2Fwww.domain.nl%2Finternet%5D%5D
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8QoGI
function name:  (null)
number of ops:  10
compiled vars:  !0 = $message
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Ca+href%3D%22https%3A%2F%2Fwww.domain.nl%2Finternet%22+target%3D%22_blank%22+title%3D%22https%3A%2F%2Fwww.domain.nl%2Finternet%22%3Ehttps%3A%2F%2Fwww.domain.nl%2Finternet%3C%2Fa%3E'
    5     1        INIT_FCALL                                               'preg_replace_callback'
          2        SEND_VAL                                                 '%7E%5Cshref%3D%5B%27%22%5D%5CKhttps%3F%3A%2F%2Fwww%5C.domain%5C.nl%28%3F%3A%2F%5B%5E%5Cs%22%27%3C%3E%5D%2A%29%3F%7Ei'
          3        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
    7     4        SEND_VAL                                                 ~2
          5        SEND_VAR                                                 !0
    5     6        DO_ICALL                                         $3      
          7        ASSIGN                                                   !0, $3
    8     8        ECHO                                                     !0
          9      > 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/8QoGI
function name:  {closure}
number of ops:  10
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        INIT_FCALL                                               'urlencode'
          2        FETCH_DIM_R                                      ~1      !0, 0
          3        CONCAT                                           ~2      '%5B%5B', ~1
          4        CONCAT                                           ~3      ~2, '%5D%5D'
          5        SEND_VAL                                                 ~3
          6        DO_ICALL                                         $4      
          7        CONCAT                                           ~5      'https%3A%2F%2Fwww.affiliatedomain.com%2Fcread.php%3Fid%3D1234%26amp%3Baffid%3D12345%26amp%3Bclickref%3Dme%26amp%3Bp%3D', $4
          8      > RETURN                                                   ~5
    7     9*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.76 ms | 1011 KiB | 15 Q