3v4l.org

run code in 300+ PHP versions simultaneously
<?php $urls=[ 'http://domain1.com/media/uploads/2017/11/image-test-1.jpg', 'https://domain2.org/photos/uploads/2016/08/anotherimage.png' ]; $urls=preg_replace('~https?://(?:[^/]*/)*~','images/',$urls); var_export($urls);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1MGIZ
function name:  (null)
number of ops:  11
compiled vars:  !0 = $urls
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    7     1        INIT_FCALL                                               'preg_replace'
          2        SEND_VAL                                                 '%7Ehttps%3F%3A%2F%2F%28%3F%3A%5B%5E%2F%5D%2A%2F%29%2A%7E'
          3        SEND_VAL                                                 'images%2F'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $2      
          6        ASSIGN                                                   !0, $2
    9     7        INIT_FCALL                                               'var_export'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.84 ms | 1010 KiB | 15 Q