3v4l.org

run code in 300+ PHP versions simultaneously
<?php $freshdate = '09/07/2015 (Mon)'; $date = DateTime::createFromFormat("m/d/Y (D", rtrim($freshdate, ')')); if (!$date) { var_dump('error', DateTime::getLastErrors()); } echo $date->format('Y-m-d H:i:s');
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 18
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/uCiFS
function name:  (null)
number of ops:  23
compiled vars:  !0 = $freshdate, !1 = $date
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '09%2F07%2F2015+%28Mon%29'
    4     1        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
          2        SEND_VAL                                                 'm%2Fd%2FY+%28D'
          3        INIT_FCALL                                               'rtrim'
          4        SEND_VAR                                                 !0
          5        SEND_VAL                                                 '%29'
          6        DO_ICALL                                         $3      
          7        SEND_VAR                                                 $3
          8        DO_FCALL                                      0  $4      
          9        ASSIGN                                                   !1, $4
    5    10        BOOL_NOT                                         ~6      !1
         11      > JMPZ                                                     ~6, ->18
    6    12    >   INIT_FCALL                                               'var_dump'
         13        SEND_VAL                                                 'error'
         14        INIT_STATIC_METHOD_CALL                                  'DateTime', 'getLastErrors'
         15        DO_FCALL                                      0  $7      
         16        SEND_VAR                                                 $7
         17        DO_ICALL                                                 
    8    18    >   INIT_METHOD_CALL                                         !1, 'format'
         19        SEND_VAL_EX                                              'Y-m-d+H%3Ai%3As'
         20        DO_FCALL                                      0  $9      
         21        ECHO                                                     $9
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.23 ms | 1395 KiB | 17 Q