3v4l.org

run code in 300+ PHP versions simultaneously
<?php $relativeUrl = "/companies/(\d+)/advert-sets|/companies/advert-sets"; $currentUrl = "/companies/advert-sets"; preg_match('#' . $relativeUrl . "#", $currentUrl, $matches); var_dump($matches);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/eW6rm
function name:  (null)
number of ops:  13
compiled vars:  !0 = $relativeUrl, !1 = $currentUrl, !2 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2Fcompanies%2F%28%5Cd%2B%29%2Fadvert-sets%7C%2Fcompanies%2Fadvert-sets'
    4     1        ASSIGN                                                   !1, '%2Fcompanies%2Fadvert-sets'
    6     2        INIT_FCALL                                               'preg_match'
          3        CONCAT                                           ~5      '%23', !0
          4        CONCAT                                           ~6      ~5, '%23'
          5        SEND_VAL                                                 ~6
          6        SEND_VAR                                                 !1
          7        SEND_REF                                                 !2
          8        DO_ICALL                                                 
    8     9        INIT_FCALL                                               'var_dump'
         10        SEND_VAR                                                 !2
         11        DO_ICALL                                                 
         12      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.05 ms | 1385 KiB | 17 Q