3v4l.org

run code in 300+ PHP versions simultaneously
<?php $d1 = '2014-10-25 00:00:01'; $d2 = '2014-10-26 00:00:00'; $dt1 = new DateTime($d1); $dt2 = new DateTime($d2); var_dump ($dt2->diff($dt1)->d); var_dump (strtotime($d2)-strtotime($d1));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DENP5
function name:  (null)
number of ops:  28
compiled vars:  !0 = $d1, !1 = $d2, !2 = $dt1, !3 = $dt2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '2014-10-25+00%3A00%3A01'
    3     1        ASSIGN                                                   !1, '2014-10-26+00%3A00%3A00'
    4     2        NEW                                              $6      'DateTime'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !2, $6
    5     6        NEW                                              $9      'DateTime'
          7        SEND_VAR_EX                                              !1
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !3, $9
    7    10        INIT_FCALL                                               'var_dump'
         11        INIT_METHOD_CALL                                         !3, 'diff'
         12        SEND_VAR_EX                                              !2
         13        DO_FCALL                                      0  $12     
         14        FETCH_OBJ_R                                      ~13     $12, 'd'
         15        SEND_VAL                                                 ~13
         16        DO_ICALL                                                 
    8    17        INIT_FCALL                                               'var_dump'
         18        INIT_FCALL                                               'strtotime'
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                         $15     
         21        INIT_FCALL                                               'strtotime'
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                         $16     
         24        SUB                                              ~17     $15, $16
         25        SEND_VAL                                                 ~17
         26        DO_ICALL                                                 
         27      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.32 ms | 1395 KiB | 17 Q