3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "/companies/(\d+)/adverts/new/(\d+)"; $result = vsprintf(preg_replace('#\((.*?)\)#', '%s', $string, -1, $count), $replace); var_dump($result);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/9sABS
function name:  (null)
number of ops:  17
compiled vars:  !0 = $string, !1 = $result, !2 = $count, !3 = $replace
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        INIT_FCALL                                               'vsprintf'
          2        INIT_FCALL                                               'preg_replace'
          3        SEND_VAL                                                 '%23%5C%28%28.%2A%3F%29%5C%29%23'
          4        SEND_VAL                                                 '%25s'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 -1
          7        SEND_REF                                                 !2
          8        DO_ICALL                                         $5      
          9        SEND_VAR                                                 $5
         10        SEND_VAR                                                 !3
         11        DO_ICALL                                         $6      
         12        ASSIGN                                                   !1, $6
    5    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAR                                                 !1
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.85 ms | 1386 KiB | 19 Q