3v4l.org

run code in 200+ PHP versions simultaneously
<?php $dateofbirth = '31/11/80'; $date = DateTime::createFromFormat('d/m/Y', $dateofbirth); $date_errors = DateTime::getLastErrors(); if ($date_errors['warning_count'] + $date_errors['error_count'] > 0) { echo 'Date '.$dateofbirth.' is not a valid DD/MM/YYYY format.'; } else { echo $date->format('Y-m-d'); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 18
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/KdYbE
function name:  (null)
number of ops:  23
compiled vars:  !0 = $dateofbirth, !1 = $date, !2 = $date_errors
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   QM_ASSIGN                                                !0
   3     1        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
         2        SEND_VAL                                                 'd%2Fm%2FY'
         3        SEND_VAR                                                 !0
         4        DO_FCALL                                      0  $4      
         5        QM_ASSIGN                                                !1
   5     6        INIT_STATIC_METHOD_CALL                                  'DateTime', 'getLastErrors'
         7        DO_FCALL                                      0  $6      
         8        QM_ASSIGN                                                !2
   6     9        FETCH_DIM_R                                      ~8      !2, 'warning_count'
        10        FETCH_DIM_R                                      ~9      !2, 'error_count'
        11        ADD                                              ~10     ~8, ~9
        12        IS_SMALLER_OR_EQUAL                              ~11     0, ~10
        13      > JMPZ                                                     ~11, ->18
   7    14    >   CONCAT                                           ~12     'Date+', !0
        15        CONCAT                                           ~13     ~12, '+is+not+a+valid+DD%2FMM%2FYYYY+format.'
        16        ASSIGN_OBJ                                               ~13
        17      > JMP                                                      ->22
  10    18    >   INIT_METHOD_CALL                                         !1, 'format'
        19        SEND_VAL_EX                                              'Y-m-d'
        20        DO_FCALL                                      0  $14     
        21        ASSIGN_OBJ                                               $14
  11    22    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.4.0