3v4l.org

run code in 300+ PHP versions simultaneously
<?php function createDateFromFormat($format, $time) { $result = \DateTimeImmutable::createFromFormat($format, $time); var_dump(\DateTime::getLastErrors()); return $result; } var_dump(\DateTimeImmutable::createFromFormat('Y-m-d|', '2000-15-0')); $errors = \DateTime::getLastErrors(); var_dump(\DateTime::getLastErrors()); if (!empty($errors['warning_count'])) { return false; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 19
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qlXIU
function name:  (null)
number of ops:  20
compiled vars:  !0 = $errors
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'var_dump'
          1        INIT_STATIC_METHOD_CALL                                  'DateTimeImmutable', 'createFromFormat'
          2        SEND_VAL                                                 'Y-m-d%7C'
          3        SEND_VAL                                                 '2000-15-0'
          4        DO_FCALL                                      0  $1      
          5        SEND_VAR                                                 $1
          6        DO_ICALL                                                 
   17     7        INIT_STATIC_METHOD_CALL                                  'DateTime', 'getLastErrors'
          8        DO_FCALL                                      0  $3      
          9        ASSIGN                                                   !0, $3
   18    10        INIT_FCALL                                               'var_dump'
         11        INIT_STATIC_METHOD_CALL                                  'DateTime', 'getLastErrors'
         12        DO_FCALL                                      0  $5      
         13        SEND_VAR                                                 $5
         14        DO_ICALL                                                 
   19    15        ISSET_ISEMPTY_DIM_OBJ                         1  ~7      !0, 'warning_count'
         16        BOOL_NOT                                         ~8      ~7
         17      > JMPZ                                                     ~8, ->19
   20    18    > > RETURN                                                   <false>
   21    19    > > RETURN                                                   1

Function createdatefromformat:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qlXIU
function name:  createDateFromFormat
number of ops:  14
compiled vars:  !0 = $format, !1 = $time, !2 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    7     2        INIT_STATIC_METHOD_CALL                                  'DateTimeImmutable', 'createFromFormat'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_FCALL                                      0  $3      
          6        ASSIGN                                                   !2, $3
    8     7        INIT_FCALL                                               'var_dump'
          8        INIT_STATIC_METHOD_CALL                                  'DateTime', 'getLastErrors'
          9        DO_FCALL                                      0  $5      
         10        SEND_VAR                                                 $5
         11        DO_ICALL                                                 
   10    12      > RETURN                                                   !2
   11    13*     > RETURN                                                   null

End of function createdatefromformat

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.12 ms | 1396 KiB | 15 Q