3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = "2013-12-09"; if (ereg ("([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})", $date, $regs)) { print_r( $regs ); } else { echo "Invalid date format: $date"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 11
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VMpeQ
function name:  (null)
number of ops:  15
compiled vars:  !0 = $date, !1 = $regs
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '2013-12-09'
    3     1        INIT_FCALL_BY_NAME                                       'ereg'
          2        SEND_VAL_EX                                              '%28%5B0-9%5D%7B4%7D%29-%28%5B0-9%5D%7B1%2C2%7D%29-%28%5B0-9%5D%7B1%2C2%7D%29'
          3        SEND_VAR_EX                                              !0
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0  $3      
          6      > JMPZ                                                     $3, ->11
    4     7    >   INIT_FCALL                                               'print_r'
          8        SEND_VAR                                                 !1
          9        DO_ICALL                                                 
         10      > JMP                                                      ->14
    6    11    >   NOP                                                      
         12        FAST_CONCAT                                      ~5      'Invalid+date+format%3A+', !0
         13        ECHO                                                     ~5
    7    14    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.84 ms | 1394 KiB | 15 Q