3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = new DateTime('2014-11-01 01:01:01'); $finish = new DateTime('2014-11-02 03:02:01'); $interval = $finish->diff($start); echo $interval->format('%H:%I:%S'), PHP_EOL; $star = '2014-11-01 01:01:01'; $finish = '2014-11-02 03:02:01'; $s = strtotime($star); $f = strtotime($finish); $e = $f-$s; echo sec2date($e); function sec2date($secs) { $sec = $secs%60; $jam = intval($secs/3600); $menit = intval($secs/60)%60; $sec = ($sec < 10)?"0$sec":"$sec"; $jam = ($jam < 10)?"0$jam":"$jam"; $menit = ($menit < 10) ? "0$menit" : "$menit"; return "$jam:$menit:$sec"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/evpST
function name:  (null)
number of ops:  34
compiled vars:  !0 = $start, !1 = $finish, !2 = $interval, !3 = $star, !4 = $s, !5 = $f, !6 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $7      'DateTime'
          1        SEND_VAL_EX                                              '2014-11-01+01%3A01%3A01'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $7
    4     4        NEW                                              $10     'DateTime'
          5        SEND_VAL_EX                                              '2014-11-02+03%3A02%3A01'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !1, $10
    6     8        INIT_METHOD_CALL                                         !1, 'diff'
          9        SEND_VAR_EX                                              !0
         10        DO_FCALL                                      0  $13     
         11        ASSIGN                                                   !2, $13
    7    12        INIT_METHOD_CALL                                         !2, 'format'
         13        SEND_VAL_EX                                              '%25H%3A%25I%3A%25S'
         14        DO_FCALL                                      0  $15     
         15        ECHO                                                     $15
         16        ECHO                                                     '%0A'
    9    17        ASSIGN                                                   !3, '2014-11-01+01%3A01%3A01'
   10    18        ASSIGN                                                   !1, '2014-11-02+03%3A02%3A01'
   11    19        INIT_FCALL                                               'strtotime'
         20        SEND_VAR                                                 !3
         21        DO_ICALL                                         $18     
         22        ASSIGN                                                   !4, $18
   12    23        INIT_FCALL                                               'strtotime'
         24        SEND_VAR                                                 !1
         25        DO_ICALL                                         $20     
         26        ASSIGN                                                   !5, $20
   13    27        SUB                                              ~22     !5, !4
         28        ASSIGN                                                   !6, ~22
   14    29        INIT_FCALL_BY_NAME                                       'sec2date'
         30        SEND_VAR_EX                                              !6
         31        DO_FCALL                                      0  $24     
         32        ECHO                                                     $24
   23    33      > RETURN                                                   1

Function sec2date:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 12, Position 2 = 16
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 25
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 34
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 36
Branch analysis from position: 36
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 34
Branch analysis from position: 30
Branch analysis from position: 34
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 25
Branch analysis from position: 21
Branch analysis from position: 25
filename:       /in/evpST
function name:  sec2date
number of ops:  44
compiled vars:  !0 = $secs, !1 = $sec, !2 = $jam, !3 = $menit
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1        MOD                                              ~4      !0, 60
          2        ASSIGN                                                   !1, ~4
   17     3        DIV                                              ~6      !0, 3600
          4        CAST                                          4  ~7      ~6
          5        ASSIGN                                                   !2, ~7
   18     6        DIV                                              ~9      !0, 60
          7        CAST                                          4  ~10     ~9
          8        MOD                                              ~11     ~10, 60
          9        ASSIGN                                                   !3, ~11
   19    10        IS_SMALLER                                               !1, 10
         11      > JMPZ                                                     ~13, ->16
         12    >   NOP                                                      
         13        FAST_CONCAT                                      ~14     '0', !1
         14        QM_ASSIGN                                        ~15     ~14
         15      > JMP                                                      ->18
         16    >   CAST                                          6  ~16     !1
         17        QM_ASSIGN                                        ~15     ~16
         18    >   ASSIGN                                                   !1, ~15
   20    19        IS_SMALLER                                               !2, 10
         20      > JMPZ                                                     ~18, ->25
         21    >   NOP                                                      
         22        FAST_CONCAT                                      ~19     '0', !2
         23        QM_ASSIGN                                        ~20     ~19
         24      > JMP                                                      ->27
         25    >   CAST                                          6  ~21     !2
         26        QM_ASSIGN                                        ~20     ~21
         27    >   ASSIGN                                                   !2, ~20
   21    28        IS_SMALLER                                               !3, 10
         29      > JMPZ                                                     ~23, ->34
         30    >   NOP                                                      
         31        FAST_CONCAT                                      ~24     '0', !3
         32        QM_ASSIGN                                        ~25     ~24
         33      > JMP                                                      ->36
         34    >   CAST                                          6  ~26     !3
         35        QM_ASSIGN                                        ~25     ~26
         36    >   ASSIGN                                                   !3, ~25
   22    37        ROPE_INIT                                     5  ~29     !2
         38        ROPE_ADD                                      1  ~29     ~29, '%3A'
         39        ROPE_ADD                                      2  ~29     ~29, !3
         40        ROPE_ADD                                      3  ~29     ~29, '%3A'
         41        ROPE_END                                      4  ~28     ~29, !1
         42      > RETURN                                                   ~28
   23    43*     > RETURN                                                   null

End of function sec2date

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.25 ms | 1404 KiB | 15 Q