3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = '09-02-2018'; $d = DateTime::createFromFormat('d-m-Y', $date); var_dump($d); var_dump($d && $d->format($format) === $date);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 46) Position 1 = 11, Position 2 = 16
Branch analysis from position: 11
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/4qpM2
function name:  (null)
number of ops:  19
compiled vars:  !0 = $date, !1 = $d, !2 = $format
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '09-02-2018'
    5     1        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
          2        SEND_VAL                                                 'd-m-Y'
          3        SEND_VAR                                                 !0
          4        DO_FCALL                                      0  $4      
          5        ASSIGN                                                   !1, $4
    7     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
    9     9        INIT_FCALL                                               'var_dump'
         10      > JMPZ_EX                                          ~7      !1, ->16
         11    >   INIT_METHOD_CALL                                         !1, 'format'
         12        SEND_VAR_EX                                              !2
         13        DO_FCALL                                      0  $8      
         14        IS_IDENTICAL                                     ~9      !0, $8
         15        BOOL                                             ~7      ~9
         16    >   SEND_VAL                                                 ~7
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.5 ms | 1395 KiB | 15 Q