3v4l.org

run code in 300+ PHP versions simultaneously
<?php function convert($url) { return preg_replace(':\/\/([^.]*\.)?mydomain\.tld', '://example.dev', $url); } var_dump(convert('http://haha.com/ferfe')); var_dump(convert('https://haha.com/ferfe')); var_dump(convert('http://foo.haha.com/ferfe')); var_dump(convert('https://foo.haha.com/ferfe'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9ACf0
function name:  (null)
number of ops:  25
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_FCALL                                               'convert'
          2        SEND_VAL                                                 'http%3A%2F%2Fhaha.com%2Fferfe'
          3        DO_FCALL                                      0  $0      
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                                 
    8     6        INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'convert'
          8        SEND_VAL                                                 'https%3A%2F%2Fhaha.com%2Fferfe'
          9        DO_FCALL                                      0  $2      
         10        SEND_VAR                                                 $2
         11        DO_ICALL                                                 
    9    12        INIT_FCALL                                               'var_dump'
         13        INIT_FCALL                                               'convert'
         14        SEND_VAL                                                 'http%3A%2F%2Ffoo.haha.com%2Fferfe'
         15        DO_FCALL                                      0  $4      
         16        SEND_VAR                                                 $4
         17        DO_ICALL                                                 
   10    18        INIT_FCALL                                               'var_dump'
         19        INIT_FCALL                                               'convert'
         20        SEND_VAL                                                 'https%3A%2F%2Ffoo.haha.com%2Fferfe'
         21        DO_FCALL                                      0  $6      
         22        SEND_VAR                                                 $6
         23        DO_ICALL                                                 
         24      > RETURN                                                   1

Function convert:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9ACf0
function name:  convert
number of ops:  8
compiled vars:  !0 = $url
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
    4     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%3A%5C%2F%5C%2F%28%5B%5E.%5D%2A%5C.%29%3Fmydomain%5C.tld'
          3        SEND_VAL                                                 '%3A%2F%2Fexample.dev'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $1      
          6      > RETURN                                                   $1
    5     7*     > RETURN                                                   null

End of function convert

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.62 ms | 1399 KiB | 21 Q