3v4l.org

run code in 300+ PHP versions simultaneously
<?php $d1=secondsToTime("58875"); echo $d1; function secondsToTime($seconds) { $dtF = new DateTime("@0"); $dtT = new DateTime("@$seconds"); return $dtF->diff($dtT)->format('%a days, %h hours, %i minutes and %s seconds'); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4cvDB
function name:  (null)
number of ops:  6
compiled vars:  !0 = $d1
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL_BY_NAME                                       'secondsToTime'
          1        SEND_VAL_EX                                              '58875'
          2        DO_FCALL                                      0  $1      
          3        ASSIGN                                                   !0, $1
    3     4        ECHO                                                     !0
   10     5      > RETURN                                                   1

Function secondstotime:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4cvDB
function name:  secondsToTime
number of ops:  19
compiled vars:  !0 = $seconds, !1 = $dtF, !2 = $dtT
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        NEW                                              $3      'DateTime'
          2        SEND_VAL_EX                                              '%400'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $3
    8     5        NEW                                              $6      'DateTime'
          6        NOP                                                      
          7        FAST_CONCAT                                      ~7      '%40', !0
          8        SEND_VAL_EX                                              ~7
          9        DO_FCALL                                      0          
         10        ASSIGN                                                   !2, $6
    9    11        INIT_METHOD_CALL                                         !1, 'diff'
         12        SEND_VAR_EX                                              !2
         13        DO_FCALL                                      0  $10     
         14        INIT_METHOD_CALL                                         $10, 'format'
         15        SEND_VAL_EX                                              '%25a+days%2C+%25h+hours%2C+%25i+minutes+and+%25s+seconds'
         16        DO_FCALL                                      0  $11     
         17      > RETURN                                                   $11
   10    18*     > RETURN                                                   null

End of function secondstotime

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.73 ms | 1394 KiB | 13 Q