3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dateTime = '2007-01-11 12:34:56'; preg_match('~(\d{4}-\d{2}-\d{2})\s?(\d{2}:\d{2}:\d{2})?~', $dateTime, $matches); $matches['time'] = array_key_exists('time', $matches) ? $matches['time'] : '00:00:00'; var_dump($matches);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 11
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 12
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uDK3u
function name:  (null)
number of ops:  18
compiled vars:  !0 = $dateTime, !1 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '2007-01-11+12%3A34%3A56'
    4     1        INIT_FCALL                                               'preg_match'
          2        SEND_VAL                                                 '%7E%28%5Cd%7B4%7D-%5Cd%7B2%7D-%5Cd%7B2%7D%29%5Cs%3F%28%5Cd%7B2%7D%3A%5Cd%7B2%7D%3A%5Cd%7B2%7D%29%3F%7E'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        DO_ICALL                                                 
    5     6        ARRAY_KEY_EXISTS                                         'time', !1
          7      > JMPZ                                                     ~5, ->11
          8    >   FETCH_DIM_R                                      ~6      !1, 'time'
          9        QM_ASSIGN                                        ~7      ~6
         10      > JMP                                                      ->12
         11    >   QM_ASSIGN                                        ~7      '00%3A00%3A00'
         12    >   ASSIGN_DIM                                               !1, 'time'
         13        OP_DATA                                                  ~7
    7    14        INIT_FCALL                                               'var_dump'
         15        SEND_VAR                                                 !1
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.2 ms | 1395 KiB | 17 Q