3v4l.org

run code in 300+ PHP versions simultaneously
<?php $interval_in_seconds = 12 * 86400; $checkin_in_seconds = floor(1413926734544 / 1000); $next_checkin = $checkin_in_seconds + $interval_in_seconds; $until_next = $next_checkin - time(); if($until_next > 0) { $days = floor($until_next / 86400); function secondsToTime($seconds) { // Only here for var_dump testing: global $settings, $interval_in_seconds, $until_next, $next_checkin; $dtF = new DateTime("@0"); $dtT = new DateTime("@$seconds"); var_dump($until_next); $return = $dtF->diff($dtT)->format('%h hours, %i minutes and %s seconds'); var_dump($until_next); return $return; } $countdown = $days . ' days, ' . secondsToTime($until_next); } echo $countdown;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 25
Branch analysis from position: 13
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
filename:       /in/8pBXR
function name:  (null)
number of ops:  27
compiled vars:  !0 = $interval_in_seconds, !1 = $checkin_in_seconds, !2 = $next_checkin, !3 = $until_next, !4 = $days, !5 = $countdown
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 1036800
    4     1        INIT_FCALL                                               'floor'
          2        SEND_VAL                                                 1.41393e+9
          3        DO_ICALL                                         $7      
          4        ASSIGN                                                   !1, $7
    5     5        ADD                                              ~9      !1, !0
          6        ASSIGN                                                   !2, ~9
    6     7        INIT_FCALL                                               'time'
          8        DO_ICALL                                         $11     
          9        SUB                                              ~12     !2, $11
         10        ASSIGN                                                   !3, ~12
    8    11        IS_SMALLER                                               0, !3
         12      > JMPZ                                                     ~14, ->25
    9    13    >   INIT_FCALL                                               'floor'
         14        DIV                                              ~15     !3, 86400
         15        SEND_VAL                                                 ~15
         16        DO_ICALL                                         $16     
         17        ASSIGN                                                   !4, $16
   11    18        DECLARE_FUNCTION                                         'secondstotime'
   24    19        CONCAT                                           ~18     !4, '+days%2C+'
         20        INIT_FCALL_BY_NAME                                       'secondsToTime'
         21        SEND_VAR_EX                                              !3
         22        DO_FCALL                                      0  $19     
         23        CONCAT                                           ~20     ~18, $19
         24        ASSIGN                                                   !5, ~20
   27    25    >   ECHO                                                     !5
         26      > RETURN                                                   1

Function %00secondstotime%2Fin%2F8pBXR%3A11%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/8pBXR
function name:  secondsToTime
number of ops:  30
compiled vars:  !0 = $seconds, !1 = $settings, !2 = $interval_in_seconds, !3 = $until_next, !4 = $next_checkin, !5 = $dtF, !6 = $dtT, !7 = $return
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   13     1        BIND_GLOBAL                                              !1, 'settings'
          2        BIND_GLOBAL                                              !2, 'interval_in_seconds'
          3        BIND_GLOBAL                                              !3, 'until_next'
          4        BIND_GLOBAL                                              !4, 'next_checkin'
   15     5        NEW                                              $8      'DateTime'
          6        SEND_VAL_EX                                              '%400'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !5, $8
   16     9        NEW                                              $11     'DateTime'
         10        NOP                                                      
         11        FAST_CONCAT                                      ~12     '%40', !0
         12        SEND_VAL_EX                                              ~12
         13        DO_FCALL                                      0          
         14        ASSIGN                                                   !6, $11
   18    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !3
         17        DO_ICALL                                                 
   19    18        INIT_METHOD_CALL                                         !5, 'diff'
         19        SEND_VAR_EX                                              !6
         20        DO_FCALL                                      0  $16     
         21        INIT_METHOD_CALL                                         $16, 'format'
         22        SEND_VAL_EX                                              '%25h+hours%2C+%25i+minutes+and+%25s+seconds'
         23        DO_FCALL                                      0  $17     
         24        ASSIGN                                                   !7, $17
   20    25        INIT_FCALL                                               'var_dump'
         26        SEND_VAR                                                 !3
         27        DO_ICALL                                                 
   22    28      > RETURN                                                   !7
   23    29*     > RETURN                                                   null

End of function %00secondstotime%2Fin%2F8pBXR%3A11%240

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.23 ms | 1400 KiB | 19 Q