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_match($regex, $year, $matches[1]); print_r($matches); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F3Rdj
function name:  (null)
number of ops:  20
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%28%5Cd%7B0%2C4%7D%2B%28%3F%3A-%5Cd%7B0%2C4%7D%2B%29%3F%29%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        DO_ICALL                                                 
   10    10        INIT_FCALL                                               'preg_match'
         11        SEND_VAR                                                 !2
         12        SEND_VAR                                                 !0
         13        FETCH_DIM_W                                      $10     !3, 1
         14        SEND_REF                                                 $10
         15        DO_ICALL                                                 
   12    16        INIT_FCALL                                               'print_r'
         17        SEND_VAR                                                 !3
         18        DO_ICALL                                                 
   14    19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
168.8 ms | 1395 KiB | 17 Q