3v4l.org

run code in 300+ PHP versions simultaneously
<?php // get the old DateTime object created from the month and year $oldDate = date_create_from_format("n Y", "10 2013"); // get the current DateTime object $currentDate = new DateTime(); // calculate the interval between the two $dateInterval = $currentDate->diff($oldDate,true); echo $dateInterval->m;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/23hKF
function name:  (null)
number of ops:  16
compiled vars:  !0 = $oldDate, !1 = $currentDate, !2 = $dateInterval
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'date_create_from_format'
          1        SEND_VAL                                                 'n+Y'
          2        SEND_VAL                                                 '10+2013'
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !0, $3
    5     5        NEW                                              $5      'DateTime'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $5
    7     8        INIT_METHOD_CALL                                         !1, 'diff'
          9        SEND_VAR_EX                                              !0
         10        SEND_VAL_EX                                              <true>
         11        DO_FCALL                                      0  $8      
         12        ASSIGN                                                   !2, $8
    8    13        FETCH_OBJ_R                                      ~10     !2, 'm'
         14        ECHO                                                     ~10
         15      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.41 ms | 1394 KiB | 15 Q