3v4l.org

run code in 300+ PHP versions simultaneously
<?php $year = "2008"; $range = "2008-2013"; $regex = "/^(\d{0,4}+(?:-\d{0,4}+)?)$/is"; $matches = array(array()); preg_match($regex, $range, $matches[0], PREG_OFFSET_CAPTURE); preg_match($regex, $year, $matches[1], PREG_OFFSET_CAPTURE); print_r($matches); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MOem6
function name:  (null)
number of ops:  22
compiled vars:  !0 = $year, !1 = $range, !2 = $regex, !3 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '2008'
    4     1        ASSIGN                                                   !1, '2008-2013'
    6     2        ASSIGN                                                   !2, '%2F%5E%28%5Cd%7B0%2C4%7D%2B%28%3F%3A-%5Cd%7B0%2C4%7D%2B%29%3F%29%24%2Fis'
    7     3        ASSIGN                                                   !3, <array>
    9     4        INIT_FCALL                                               'preg_match'
          5        SEND_VAR                                                 !2
          6        SEND_VAR                                                 !1
          7        FETCH_DIM_W                                      $8      !3, 0
          8        SEND_REF                                                 $8
          9        SEND_VAL                                                 256
         10        DO_ICALL                                                 
   10    11        INIT_FCALL                                               'preg_match'
         12        SEND_VAR                                                 !2
         13        SEND_VAR                                                 !0
         14        FETCH_DIM_W                                      $10     !3, 1
         15        SEND_REF                                                 $10
         16        SEND_VAL                                                 256
         17        DO_ICALL                                                 
   12    18        INIT_FCALL                                               'print_r'
         19        SEND_VAR                                                 !3
         20        DO_ICALL                                                 
   14    21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.79 ms | 1386 KiB | 17 Q