3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo secondsToTime(7467); function secondsToTime($seconds) { $dtF = new \DateTime("@0"); $dtT = new \DateTime("@$seconds"); if($seconds < 3600) { $format = '%i 分 %s 秒'; } elseif($seconds > 86400) { $format = '%a 天 %h 小时 %i 分 %s 秒'; } else { $format = '%h 小时 %i 分 %s 秒'; } return $dtF->diff($dtT)->format($format); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fdRRN
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL_BY_NAME                                       'secondsToTime'
          1        SEND_VAL_EX                                              7467
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
   16     4      > RETURN                                                   1

Function secondstotime:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fdRRN
function name:  secondsToTime
number of ops:  28
compiled vars:  !0 = $seconds, !1 = $dtF, !2 = $dtT, !3 = $format
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        NEW                                              $4      'DateTime'
          2        SEND_VAL_EX                                              '%400'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $4
    7     5        NEW                                              $7      'DateTime'
          6        NOP                                                      
          7        FAST_CONCAT                                      ~8      '%40', !0
          8        SEND_VAL_EX                                              ~8
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $7
    8    11        IS_SMALLER                                               !0, 3600
         12      > JMPZ                                                     ~11, ->15
    9    13    >   ASSIGN                                                   !3, '%25i+%E5%88%86+%25s+%E7%A7%92'
         14      > JMP                                                      ->20
   10    15    >   IS_SMALLER                                               86400, !0
         16      > JMPZ                                                     ~13, ->19
   11    17    >   ASSIGN                                                   !3, '%25a+%E5%A4%A9+%25h+%E5%B0%8F%E6%97%B6+%25i+%E5%88%86+%25s+%E7%A7%92'
         18      > JMP                                                      ->20
   13    19    >   ASSIGN                                                   !3, '%25h+%E5%B0%8F%E6%97%B6+%25i+%E5%88%86+%25s+%E7%A7%92'
   15    20    >   INIT_METHOD_CALL                                         !1, 'diff'
         21        SEND_VAR_EX                                              !2
         22        DO_FCALL                                      0  $16     
         23        INIT_METHOD_CALL                                         $16, 'format'
         24        SEND_VAR_EX                                              !3
         25        DO_FCALL                                      0  $17     
         26      > RETURN                                                   $17
   16    27*     > RETURN                                                   null

End of function secondstotime

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.1 ms | 1399 KiB | 13 Q