3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $datetime1 = new DateTime('2014-02-21'); $datetime2 = new DateTime('1900-01-01'); $interval = $datetime2->diff($datetime1); $excelDate = $interval->days + 2; print $excelDate;
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/fC7YH
function name:  (null)
number of ops:  17
compiled vars:  !0 = $datetime1, !1 = $datetime2, !2 = $interval, !3 = $excelDate
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   2     0  E >   NEW                                              $4      :-6
         1        SEND_VAL_EX                                              '2014-02-21'
         2        DO_FCALL                                      0          
         3        ASSIGN                                                   !0, $4
   3     4        NEW                                              $7      :-3
         5        SEND_VAL_EX                                              '1900-01-01'
         6        DO_FCALL                                      0          
         7        ASSIGN                                                   !1, $7
   5     8        INIT_METHOD_CALL                                         !1, 'diff'
         9        SEND_VAR_EX                                              !0
        10        DO_FCALL                                      0  $10     
        11        ASSIGN                                                   !2, $10
   6    12        FETCH_OBJ_R                                      $12     !2, 'days'
        13        ADD                                              ~13     $12, 2
        14        ASSIGN                                                   !3, ~13
   7    15        ECHO                                                     !3
        16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.2.0