3v4l.org

run code in 300+ PHP versions simultaneously
<?php $startDate = new \DateTime('-2 weeks'); $endDate = new \DateTime(); var_dump(iterator_to_array($endDate->diff($startDate)));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2iYrn
function name:  (null)
number of ops:  17
compiled vars:  !0 = $startDate, !1 = $endDate
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $2      'DateTime'
          1        SEND_VAL_EX                                              '-2+weeks'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
    3     4        NEW                                              $5      'DateTime'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $5
    4     7        INIT_FCALL                                               'var_dump'
          8        INIT_FCALL                                               'iterator_to_array'
          9        INIT_METHOD_CALL                                         !1, 'diff'
         10        SEND_VAR_EX                                              !0
         11        DO_FCALL                                      0  $8      
         12        SEND_VAR                                                 $8
         13        DO_ICALL                                         $9      
         14        SEND_VAR                                                 $9
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.47 ms | 1394 KiB | 17 Q