3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = 'htttp://www.foobar.de/slideshow?parms=11,22&something=else'; $newSlideNo = 44; $searchPattern = '/(.*\d+,\d+,)(\d*)(.*)/'; $replacePattern = sprintf('${1}' . $newSlideNo . '${3}'); var_dump(preg_replace($searchPattern, $replacePattern, $url));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jFDfm
function name:  (null)
number of ops:  18
compiled vars:  !0 = $url, !1 = $newSlideNo, !2 = $searchPattern, !3 = $replacePattern
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, 'htttp%3A%2F%2Fwww.foobar.de%2Fslideshow%3Fparms%3D11%2C22%26something%3Delse'
    3     1        ASSIGN                                                   !1, 44
    5     2        ASSIGN                                                   !2, '%2F%28.%2A%5Cd%2B%2C%5Cd%2B%2C%29%28%5Cd%2A%29%28.%2A%29%2F'
    6     3        INIT_FCALL                                               'sprintf'
          4        CONCAT                                           ~7      '%24%7B1%7D', !1
          5        CONCAT                                           ~8      ~7, '%24%7B3%7D'
          6        SEND_VAL                                                 ~8
          7        DO_ICALL                                         $9      
          8        ASSIGN                                                   !3, $9
    8     9        INIT_FCALL                                               'var_dump'
         10        INIT_FCALL                                               'preg_replace'
         11        SEND_VAR                                                 !2
         12        SEND_VAR                                                 !3
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $11     
         15        SEND_VAR                                                 $11
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.38 ms | 1395 KiB | 19 Q