3v4l.org

run code in 300+ PHP versions simultaneously
<?php $destination = "Cat-115/Tid-11"; preg_match('/Cat-115\/Tid-\K\d+/', $destination, $m); echo $m[0]; echo PHP_EOL; preg_match('/Cat-115\/Tid-(\d+)/', $destination, $m); echo $m[1];
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4WBNt
function name:  (null)
number of ops:  17
compiled vars:  !0 = $destination, !1 = $m
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Cat-115%2FTid-11'
    4     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%2FCat-115%5C%2FTid-%5CK%5Cd%2B%2F'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                                 
    5     6        FETCH_DIM_R                                      ~4      !1, 0
          7        ECHO                                                     ~4
    6     8        ECHO                                                     '%0A'
    7     9        INIT_FCALL                                               'preg_match'
         10        SEND_VAL                                                 '%2FCat-115%5C%2FTid-%28%5Cd%2B%29%2F'
         11        SEND_VAR                                                 !0
         12        SEND_REF                                                 !1
         13        DO_ICALL                                                 
    8    14        FETCH_DIM_R                                      ~6      !1, 1
         15        ECHO                                                     ~6
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
278.57 ms | 1009 KiB | 14 Q