3v4l.org

run code in 300+ PHP versions simultaneously
<?php $TargetDate = 10005248; $Offset = 14400; function TDateTime2DateTime($date,...$offset){ // Magic delphi TDateTime of 01/01/1970 $UnixStartDate = 25569.0; return round(($date - $UnixStartDate) * 86400) + (int)$offset; } function DateTime2TDateTime($date){ // Magic delphi TDateTime of 01/01/1970 $UnixStartDate = 25569.0; return (float) ($date / 86400) + $UnixStartDate; } echo TDateTime2DateTime($TargetDate,$Offset)."\n"; echo DateTime2TDateTime(862244265600);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hMVVk
function name:  (null)
number of ops:  13
compiled vars:  !0 = $TargetDate, !1 = $Offset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 10005248
    4     1        ASSIGN                                                   !1, 14400
   20     2        INIT_FCALL                                               'tdatetime2datetime'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_FCALL                                      0  $4      
          6        CONCAT                                           ~5      $4, '%0A'
          7        ECHO                                                     ~5
   22     8        INIT_FCALL                                               'datetime2tdatetime'
          9        SEND_VAL                                                 862244265600
         10        DO_FCALL                                      0  $6      
         11        ECHO                                                     $6
         12      > RETURN                                                   1

Function tdatetime2datetime:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hMVVk
function name:  TDateTime2DateTime
number of ops:  12
compiled vars:  !0 = $date, !1 = $offset, !2 = $UnixStartDate
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV_VARIADIC                                    !1      
    8     2        ASSIGN                                                   !2, 25569
   10     3        INIT_FCALL                                               'round'
          4        SUB                                              ~4      !0, !2
          5        MUL                                              ~5      ~4, 86400
          6        SEND_VAL                                                 ~5
          7        DO_ICALL                                         $6      
          8        CAST                                          4  ~7      !1
          9        ADD                                              ~8      $6, ~7
         10      > RETURN                                                   ~8
   11    11*     > RETURN                                                   null

End of function tdatetime2datetime

Function datetime2tdatetime:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hMVVk
function name:  DateTime2TDateTime
number of ops:  7
compiled vars:  !0 = $date, !1 = $UnixStartDate
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   15     1        ASSIGN                                                   !1, 25569
   17     2        DIV                                              ~3      !0, 86400
          3        CAST                                          5  ~4      ~3
          4        ADD                                              ~5      ~4, !1
          5      > RETURN                                                   ~5
   18     6*     > RETURN                                                   null

End of function datetime2tdatetime

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.33 ms | 1013 KiB | 16 Q