3v4l.org

run code in 300+ PHP versions simultaneously
<?php $updateDate = '2015-04-12'; $date1 = new DateTime(date('Y-m-d', strtotime($updateDate))); $date2 = DateTime::createFromFormat('Y-m-d', $updateDate); var_dump($date1 == $date2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rX5Hj
function name:  (null)
number of ops:  22
compiled vars:  !0 = $updateDate, !1 = $date1, !2 = $date2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '2015-04-12'
    3     1        NEW                                              $4      'DateTime'
          2        INIT_FCALL                                               'date'
          3        SEND_VAL                                                 'Y-m-d'
          4        INIT_FCALL                                               'strtotime'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $5      
          7        SEND_VAR                                                 $5
          8        DO_ICALL                                         $6      
          9        SEND_VAR_NO_REF_EX                                       $6
         10        DO_FCALL                                      0          
         11        ASSIGN                                                   !1, $4
    4    12        INIT_STATIC_METHOD_CALL                                  'DateTime', 'createFromFormat'
         13        SEND_VAL                                                 'Y-m-d'
         14        SEND_VAR                                                 !0
         15        DO_FCALL                                      0  $9      
         16        ASSIGN                                                   !2, $9
    6    17        INIT_FCALL                                               'var_dump'
         18        IS_EQUAL                                         ~11     !1, !2
         19        SEND_VAL                                                 ~11
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.91 ms | 1395 KiB | 19 Q