3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'bla bla bla http://google.com bla bla'; $fixedString = preg_replace_callback( '#[-a-zA-Z0-9@:%_\+.~\#?&//=]{2,256}\.[a-z]{2,4}\b(\/[-a-zA-Z0-9@:%_\+.~\#?&//=]*)?#si', function($matches) { return 'http://exmaple.com/visit/' . base64_encode($matches[0]); }, $string ); var_dump($fixedString);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TUktY
function name:  (null)
number of ops:  12
compiled vars:  !0 = $string, !1 = $fixedString
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'bla+bla+bla+http%3A%2F%2Fgoogle.com+bla+bla'
    5     1        INIT_FCALL                                               'preg_replace_callback'
    6     2        SEND_VAL                                                 '%23%5B-a-zA-Z0-9%40%3A%25_%5C%2B.%7E%5C%23%3F%26%2F%2F%3D%5D%7B2%2C256%7D%5C.%5Ba-z%5D%7B2%2C4%7D%5Cb%28%5C%2F%5B-a-zA-Z0-9%40%3A%25_%5C%2B.%7E%5C%23%3F%26%2F%2F%3D%5D%2A%29%3F%23si'
    7     3        DECLARE_LAMBDA_FUNCTION                          ~3      [0]
    9     4        SEND_VAL                                                 ~3
   10     5        SEND_VAR                                                 !0
    5     6        DO_ICALL                                         $4      
          7        ASSIGN                                                   !1, $4
   13     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                                 
         11      > 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/TUktY
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
    8     1        INIT_FCALL                                               'base64_encode'
          2        FETCH_DIM_R                                      ~1      !0, 0
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                         $2      
          5        CONCAT                                           ~3      'http%3A%2F%2Fexmaple.com%2Fvisit%2F', $2
          6      > RETURN                                                   ~3
    9     7*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.91 ms | 1012 KiB | 16 Q