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(); var_dump(new DateTime($time2));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/a9kEU
function name:  (null)
number of ops:  32
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                                               'var_dump'
          7        NEW                                              $9      'DateTime'
          8        SEND_VAR_EX                                              !1
          9        DO_FCALL                                      0          
         10        SEND_VAR                                                 $9
         11        DO_ICALL                                                 
         12        INIT_FCALL                                               'var_dump'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
         15      > EXIT                                                     
    8    16*       INIT_FCALL                                               'strtotime'
         17*       SEND_VAR                                                 !0
         18*       DO_ICALL                                         $13     
         19*       ASSIGN                                                   !2, $13
    9    20*       INIT_FCALL                                               'strtotime'
         21*       SEND_VAR                                                 !1
         22*       DO_ICALL                                         $15     
         23*       ASSIGN                                                   !3, $15
   17    24*       ECHO                                                     '%0A'
   18    25*       INIT_FCALL                                               'round'
         26*       SUB                                              ~17     !3, !2
         27*       DIV                                              ~18     ~17, 3600
         28*       SEND_VAL                                                 ~18
         29*       DO_ICALL                                         $19     
         30*       ECHO                                                     $19
         31*     > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.5 ms | 1396 KiB | 21 Q