3v4l.org

run code in 300+ PHP versions simultaneously
<?php $time1 = '2014-08-26 14:35:29'; $time2 = '2014-08-26 15:35:29'; $time1 = '2014-08-26 14:35:29'; $time2 = time(); echo strtotime("now"); echo "\n"; var_dump($time2 );exit; $strtotime1 = strtotime($time1); $strtotime2 = strtotime($time2); //$hourdiff = round((strtotime($strtotime2) - strtotime($strtotime1))/3600, 1); //echo $hourdiff; exit; //echo $strtotime1; //var_dump(new DateTime()); //echo $strtotime2; echo "\n"; echo round(($strtotime2 - $strtotime1)/3600);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 79) Position 1 = -2
filename:       /in/nMSni
function name:  (null)
number of ops:  30
compiled vars:  !0 = $time1, !1 = $time2, !2 = $strtotime1, !3 = $strtotime2
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '2014-08-26+14%3A35%3A29'
    3     1        ASSIGN                                                   !1, '2014-08-26+15%3A35%3A29'
    5     2        ASSIGN                                                   !0, '2014-08-26+14%3A35%3A29'
    6     3        INIT_FCALL                                               'time'
          4        DO_ICALL                                         $7      
          5        ASSIGN                                                   !1, $7
    7     6        INIT_FCALL_BY_NAME                                       'echo%C2%A0strtotime'
          7        SEND_VAL_EX                                              'now'
          8        DO_FCALL                                      0          
          9        ECHO                                                     '%0A'
    8    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                                 
         13      > EXIT                                                     
    9    14*       INIT_FCALL                                               'strtotime'
         15*       SEND_VAR                                                 !0
         16*       DO_ICALL                                         $11     
         17*       ASSIGN                                                   !2, $11
   10    18*       INIT_FCALL                                               'strtotime'
         19*       SEND_VAR                                                 !1
         20*       DO_ICALL                                         $13     
         21*       ASSIGN                                                   !3, $13
   18    22*       ECHO                                                     '%0A'
   19    23*       INIT_FCALL                                               'round'
         24*       SUB                                              ~15     !3, !2
         25*       DIV                                              ~16     ~15, 3600
         26*       SEND_VAL                                                 ~16
         27*       DO_ICALL                                         $17     
         28*       ECHO                                                     $17
         29*     > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.45 ms | 1400 KiB | 21 Q