3v4l.org

run code in 300+ PHP versions simultaneously
<?php $relativeUrl = "/string1/(\d+)/string2/(\d+)/string3"; $currentUrl = "/string1/1234/string2/5678/string3"; preg_match('#' . preg_quote($relativeUrl, '#') . "#", $currentUrl, $matches); var_dump($matches);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Nrp9M
function name:  (null)
number of ops:  17
compiled vars:  !0 = $relativeUrl, !1 = $currentUrl, !2 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2Fstring1%2F%28%5Cd%2B%29%2Fstring2%2F%28%5Cd%2B%29%2Fstring3'
    4     1        ASSIGN                                                   !1, '%2Fstring1%2F1234%2Fstring2%2F5678%2Fstring3'
    6     2        INIT_FCALL                                               'preg_match'
          3        INIT_FCALL                                               'preg_quote'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 '%23'
          6        DO_ICALL                                         $5      
          7        CONCAT                                           ~6      '%23', $5
          8        CONCAT                                           ~7      ~6, '%23'
          9        SEND_VAL                                                 ~7
         10        SEND_VAR                                                 !1
         11        SEND_REF                                                 !2
         12        DO_ICALL                                                 
    8    13        INIT_FCALL                                               'var_dump'
         14        SEND_VAR                                                 !2
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.56 ms | 1394 KiB | 19 Q