3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "/companies/(\d+)/adverts/new/(\d+)"; $replace = array(2223, 'generic'); $result = vsprintf(preg_replace('#\((.*?)\)#', '%s', $string), $replace); var_dump($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JsP5K
function name:  (null)
number of ops:  16
compiled vars:  !0 = $string, !1 = $replace, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2Fcompanies%2F%28%5Cd%2B%29%2Fadverts%2Fnew%2F%28%5Cd%2B%29'
    4     1        ASSIGN                                                   !1, <array>
    6     2        INIT_FCALL                                               'vsprintf'
          3        INIT_FCALL                                               'preg_replace'
          4        SEND_VAL                                                 '%23%5C%28%28.%2A%3F%29%5C%29%23'
          5        SEND_VAL                                                 '%25s'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $5      
          8        SEND_VAR                                                 $5
          9        SEND_VAR                                                 !1
         10        DO_ICALL                                         $6      
         11        ASSIGN                                                   !2, $6
    7    12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !2
         14        DO_ICALL                                                 
         15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.97 ms | 1394 KiB | 19 Q