3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date = DateTime::createFromFormat('Y-m-d', '2013-11-31'); $errors = DateTime::getLastErrors(); if (($errors['warning_count'] + $errors['error_count']) > 0) { throw new Exception("Invalid date!"); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 17
Branch analysis from position: 13
1 jumps found. (Code = 108) Position 1 = -2
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1vUMp
function name:  (null)
number of ops:  18
compiled vars:  !0 = $date, !1 = $errors
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
          1        SEND_VAL                                                 'Y-m-d'
          2        SEND_VAL                                                 '2013-11-31'
          3        DO_FCALL                                      0  $2      
          4        ASSIGN                                                   !0, $2
    3     5        INIT_STATIC_METHOD_CALL                                  'DateTime', 'getLastErrors'
          6        DO_FCALL                                      0  $4      
          7        ASSIGN                                                   !1, $4
    4     8        FETCH_DIM_R                                      ~6      !1, 'warning_count'
          9        FETCH_DIM_R                                      ~7      !1, 'error_count'
         10        ADD                                              ~8      ~6, ~7
         11        IS_SMALLER                                               0, ~8
         12      > JMPZ                                                     ~9, ->17
         13    >   NEW                                              $10     'Exception'
         14        SEND_VAL_EX                                              'Invalid+date%21'
         15        DO_FCALL                                      0          
         16      > THROW                                         0          $10
         17    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.18 ms | 1398 KiB | 13 Q