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; $s = 84600; // 23.5 h in seconds $d = (new \DateTime())->sub(new DateInterval('PT'.$s.'S')); echo (new \DateTime())->diff($d)->format("%a days %h:%I"), PHP_EOL;
Finding entry points
Branch analysis from position: 0
Jump found. Position 1 = -2
filename:       /in/VRcFC
function name:  (null)
number of ops:  43
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        ASSIGN                                                   !0, 84600
  10    21        NEW                                              $15     :11
        22        DO_FCALL                                      0          
        23        INIT_METHOD_CALL                                         $15, 'sub'
        24        NEW                                              $17     :15
        25        CONCAT                                           ~18     'PT', !0
        26        CONCAT                                           ~19     ~18, 'S'
        27        SEND_VAL_EX                                              ~19
        28        DO_FCALL                                      0          
        29        SEND_VAR_NO_REF                               0          $17
        30        DO_FCALL                                      0  $21     
        31        ASSIGN                                                   !1, $21
  11    32        NEW                                              $23     :19
        33        DO_FCALL                                      0          
        34        INIT_METHOD_CALL                                         $23, 'diff'
        35        SEND_VAR_EX                                              !1
        36        DO_FCALL                                      0  $25     
        37        INIT_METHOD_CALL                                         $25, 'format'
        38        SEND_VAL_EX                                              '%25a+days+%25h%3A%25I'
        39        DO_FCALL                                      0  $26     
        40        ECHO                                                     $26
        41        ECHO                                                     '%0A'
        42      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 7.1.0