3v4l.org

run code in 500+ PHP versions simultaneously
<?php $origin = new DateTime('now'); $target = new DateTime('now + 2 weeks'); $interval = $origin->diff($target); echo $interval->format('%R%a days');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/M5bZi
function name:  (null)
number of ops:  17
compiled vars:  !0 = $origin, !1 = $target, !2 = $interval
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   NEW                                                  $3      'DateTime'
          1        SEND_VAL_EX                                                  'now'
          2        DO_FCALL                                          0          
          3        ASSIGN                                                       !0, $3
    4     4        NEW                                                  $6      'DateTime'
          5        SEND_VAL_EX                                                  'now+%2B+2+weeks'
          6        DO_FCALL                                          0          
          7        ASSIGN                                                       !1, $6
    5     8        INIT_METHOD_CALL                                             !0, 'diff'
          9        SEND_VAR_EX                                                  !1
         10        DO_FCALL                                          0  $9      
         11        ASSIGN                                                       !2, $9
    6    12        INIT_METHOD_CALL                                             !2, 'format'
         13        SEND_VAL_EX                                                  '%25R%25a+days'
         14        DO_FCALL                                          0  $11     
         15        ECHO                                                         $11
         16      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
124.8 ms | 475 KiB | 7 Q