3v4l.org

run code in 300+ PHP versions simultaneously
<?php $path = '/www/nikita/tickets/web/img/news/29/29/promo_cover.jpg'; $matches = []; var_dump([ 'result' => preg_replace('/(.*)\/img\/news\/(\d+)\/(\d+)\/promo_cover\.jpg/', 'http://tickets.bp.ua', $path), ]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qRM30
function name:  (null)
number of ops:  12
compiled vars:  !0 = $path, !1 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2Fwww%2Fnikita%2Ftickets%2Fweb%2Fimg%2Fnews%2F29%2F29%2Fpromo_cover.jpg'
    4     1        ASSIGN                                                   !1, <array>
    5     2        INIT_FCALL                                               'var_dump'
    6     3        INIT_FCALL                                               'preg_replace'
          4        SEND_VAL                                                 '%2F%28.%2A%29%5C%2Fimg%5C%2Fnews%5C%2F%28%5Cd%2B%29%5C%2F%28%5Cd%2B%29%5C%2Fpromo_cover%5C.jpg%2F'
          5        SEND_VAL                                                 'http%3A%2F%2Ftickets.bp.ua'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $4      
          8        INIT_ARRAY                                       ~5      $4, 'result'
          9        SEND_VAL                                                 ~5
         10        DO_ICALL                                                 
    7    11      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.54 ms | 1394 KiB | 17 Q