3v4l.org

run code in 300+ PHP versions simultaneously
<?php $timestamps = array( strtotime("now"), strtotime("-3 seconds"), strtotime("-30 minutes"), strtotime("-60 minute"), strtotime("-90 minutes"), strtotime("-1550 minutes"), strtotime("-889385 seconds"), ); $dateTimeFile = new DateTime(); foreach ($timestamps as $timestamp) { $dateTimeFile->setTimestamp($timestamp); $interval = (new DateTime)->diff($dateTimeFile); echo sprintf( "%s%s%s%s", $interval->d > 0 ? $interval->d . "d " : "", $interval->h > 0 ? $interval->h . "h " : "", $interval->i > 0 ? $interval->i . "m " : "", $interval->s > 0 ? $interval->s . "s " : "" ); echo PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 33, Position 2 = 85
Branch analysis from position: 33
2 jumps found. (Code = 78) Position 1 = 34, Position 2 = 85
Branch analysis from position: 34
2 jumps found. (Code = 43) Position 1 = 48, Position 2 = 52
Branch analysis from position: 48
1 jumps found. (Code = 42) Position 1 = 53
Branch analysis from position: 53
2 jumps found. (Code = 43) Position 1 = 57, Position 2 = 61
Branch analysis from position: 57
1 jumps found. (Code = 42) Position 1 = 62
Branch analysis from position: 62
2 jumps found. (Code = 43) Position 1 = 66, Position 2 = 70
Branch analysis from position: 66
1 jumps found. (Code = 42) Position 1 = 71
Branch analysis from position: 71
2 jumps found. (Code = 43) Position 1 = 75, Position 2 = 79
Branch analysis from position: 75
1 jumps found. (Code = 42) Position 1 = 80
Branch analysis from position: 80
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
Branch analysis from position: 79
1 jumps found. (Code = 42) Position 1 = 33
Branch analysis from position: 33
Branch analysis from position: 70
2 jumps found. (Code = 43) Position 1 = 75, Position 2 = 79
Branch analysis from position: 75
Branch analysis from position: 79
Branch analysis from position: 61
2 jumps found. (Code = 43) Position 1 = 66, Position 2 = 70
Branch analysis from position: 66
Branch analysis from position: 70
Branch analysis from position: 52
2 jumps found. (Code = 43) Position 1 = 57, Position 2 = 61
Branch analysis from position: 57
Branch analysis from position: 61
Branch analysis from position: 85
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 85
filename:       /in/LGOer
function name:  (null)
number of ops:  87
compiled vars:  !0 = $timestamps, !1 = $dateTimeFile, !2 = $timestamp, !3 = $interval
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   INIT_FCALL                                               'strtotime'
          1        SEND_VAL                                                 'now'
          2        DO_ICALL                                         $4      
          3        INIT_ARRAY                                       ~5      $4
    5     4        INIT_FCALL                                               'strtotime'
          5        SEND_VAL                                                 '-3+seconds'
          6        DO_ICALL                                         $6      
          7        ADD_ARRAY_ELEMENT                                ~5      $6
    6     8        INIT_FCALL                                               'strtotime'
          9        SEND_VAL                                                 '-30+minutes'
         10        DO_ICALL                                         $7      
         11        ADD_ARRAY_ELEMENT                                ~5      $7
    7    12        INIT_FCALL                                               'strtotime'
         13        SEND_VAL                                                 '-60+minute'
         14        DO_ICALL                                         $8      
         15        ADD_ARRAY_ELEMENT                                ~5      $8
    8    16        INIT_FCALL                                               'strtotime'
         17        SEND_VAL                                                 '-90+minutes'
         18        DO_ICALL                                         $9      
         19        ADD_ARRAY_ELEMENT                                ~5      $9
    9    20        INIT_FCALL                                               'strtotime'
         21        SEND_VAL                                                 '-1550+minutes'
         22        DO_ICALL                                         $10     
         23        ADD_ARRAY_ELEMENT                                ~5      $10
   10    24        INIT_FCALL                                               'strtotime'
         25        SEND_VAL                                                 '-889385+seconds'
         26        DO_ICALL                                         $11     
         27        ADD_ARRAY_ELEMENT                                ~5      $11
    3    28        ASSIGN                                                   !0, ~5
   12    29        NEW                                              $13     'DateTime'
         30        DO_FCALL                                      0          
         31        ASSIGN                                                   !1, $13
   14    32      > FE_RESET_R                                       $16     !0, ->85
         33    > > FE_FETCH_R                                               $16, !2, ->85
   15    34    >   INIT_METHOD_CALL                                         !1, 'setTimestamp'
         35        SEND_VAR_EX                                              !2
         36        DO_FCALL                                      0          
   16    37        NEW                                              $18     'DateTime'
         38        DO_FCALL                                      0          
         39        INIT_METHOD_CALL                                         $18, 'diff'
         40        SEND_VAR_EX                                              !1
         41        DO_FCALL                                      0  $20     
         42        ASSIGN                                                   !3, $20
   18    43        INIT_FCALL                                               'sprintf'
   19    44        SEND_VAL                                                 '%25s%25s%25s%25s'
   20    45        FETCH_OBJ_R                                      ~22     !3, 'd'
         46        IS_SMALLER                                               0, ~22
         47      > JMPZ                                                     ~23, ->52
         48    >   FETCH_OBJ_R                                      ~24     !3, 'd'
         49        CONCAT                                           ~25     ~24, 'd+'
         50        QM_ASSIGN                                        ~26     ~25
         51      > JMP                                                      ->53
         52    >   QM_ASSIGN                                        ~26     ''
         53    >   SEND_VAL                                                 ~26
   21    54        FETCH_OBJ_R                                      ~27     !3, 'h'
         55        IS_SMALLER                                               0, ~27
         56      > JMPZ                                                     ~28, ->61
         57    >   FETCH_OBJ_R                                      ~29     !3, 'h'
         58        CONCAT                                           ~30     ~29, 'h+'
         59        QM_ASSIGN                                        ~31     ~30
         60      > JMP                                                      ->62
         61    >   QM_ASSIGN                                        ~31     ''
         62    >   SEND_VAL                                                 ~31
   22    63        FETCH_OBJ_R                                      ~32     !3, 'i'
         64        IS_SMALLER                                               0, ~32
         65      > JMPZ                                                     ~33, ->70
         66    >   FETCH_OBJ_R                                      ~34     !3, 'i'
         67        CONCAT                                           ~35     ~34, 'm+'
         68        QM_ASSIGN                                        ~36     ~35
         69      > JMP                                                      ->71
         70    >   QM_ASSIGN                                        ~36     ''
         71    >   SEND_VAL                                                 ~36
   23    72        FETCH_OBJ_R                                      ~37     !3, 's'
         73        IS_SMALLER                                               0, ~37
         74      > JMPZ                                                     ~38, ->79
         75    >   FETCH_OBJ_R                                      ~39     !3, 's'
         76        CONCAT                                           ~40     ~39, 's+'
         77        QM_ASSIGN                                        ~41     ~40
         78      > JMP                                                      ->80
         79    >   QM_ASSIGN                                        ~41     ''
         80    >   SEND_VAL                                                 ~41
         81        DO_ICALL                                         $42     
         82        ECHO                                                     $42
   25    83        ECHO                                                     '%0A'
   14    84      > JMP                                                      ->33
         85    >   FE_FREE                                                  $16
   26    86      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.16 ms | 1409 KiB | 17 Q