3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $s = 84600; // 23.5 h in seconds $s += (60*60*24)*38; // add 38 days in seconds $d = (new \DateTime())->modify("-".$s."seconds"); echo (new \DateTime())->diff($d)->format("%a days %h:%I"), PHP_EOL; $d = (new \DateTime())->sub(new DateInterval('PT'.$s.'S')); echo (new \DateTime())->diff($d)->format("%a days %h:%I"), PHP_EOL;
based on FqLgM
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/ARhJ4
function name:  (null)
number of ops:  42
compiled vars:  !0 = $s, !1 = $d
line     #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   3     0  E >   ASSIGN                                                   !0, 84600
   4     1        ASSIGN_ADD                                    0          !0, 3283200
   5     2        NEW                                              $4      :-4
         3        DO_FCALL                                      0          
         4        INIT_METHOD_CALL                                         $4, 'modify'
         5        CONCAT                                           ~6      '-', !0
         6        CONCAT                                           ~7      ~6, 'seconds'
         7        SEND_VAL_EX                                              ~7
         8        DO_FCALL                                      0  $8      
         9        ASSIGN                                                   !1, $8
   6    10        NEW                                              $10     :2
        11        DO_FCALL                                      0          
        12        INIT_METHOD_CALL                                         $10, 'diff'
        13        SEND_VAR_EX                                              !1
        14        DO_FCALL                                      0  $12     
        15        INIT_METHOD_CALL                                         $12, 'format'
        16        SEND_VAL_EX                                              '%25a+days+%25h%3A%25I'
        17        DO_FCALL                                      0  $13     
        18        ECHO                                                     $13
        19        ECHO                                                     '%0A'
   9    20        NEW                                              $14     :10
        21        DO_FCALL                                      0          
        22        INIT_METHOD_CALL                                         $14, 'sub'
        23        NEW                                              $16     :14
        24        CONCAT                                           ~17     'PT', !0
        25        CONCAT                                           ~18     ~17, 'S'
        26        SEND_VAL_EX                                              ~18
        27        DO_FCALL                                      0          
        28        SEND_VAR_NO_REF                               0          $16
        29        DO_FCALL                                      0  $20     
        30        ASSIGN                                                   !1, $20
  10    31        NEW                                              $22     :18
        32        DO_FCALL                                      0          
        33        INIT_METHOD_CALL                                         $22, 'diff'
        34        SEND_VAR_EX                                              !1
        35        DO_FCALL                                      0  $24     
        36        INIT_METHOD_CALL                                         $24, 'format'
        37        SEND_VAL_EX                                              '%25a+days+%25h%3A%25I'
        38        DO_FCALL                                      0  $25     
        39        ECHO                                                     $25
        40        ECHO                                                     '%0A'
        41      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.1.0