3v4l.org

run code in 300+ PHP versions simultaneously
<?php $time[1] = "2017-08-28 18:30:00"; $time[2] = "2017-08-28 14:00:00"; $time[3] = "2017-08-28 13:00:00"; $time[4] = "2017-08-28 12:45:00"; $time[5] = "2017-08-28 12:30:00"; $time[6] = "2017-08-28 12:00:00"; for ($i = 1; $i <= count($time) - 1; $i++) { $hourdiff = round((strtotime($time[$i + 1]) - strtotime($time[$i]))/3600, 1); echo "The difference is: $hourdiff" . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 14
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 39, Position 2 = 14
Branch analysis from position: 39
Branch analysis from position: 14
filename:       /in/Vdi24
function name:  (null)
number of ops:  40
compiled vars:  !0 = $time, !1 = $i, !2 = $hourdiff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN_DIM                                               !0, 1
          1        OP_DATA                                                  '2017-08-28+18%3A30%3A00'
    4     2        ASSIGN_DIM                                               !0, 2
          3        OP_DATA                                                  '2017-08-28+14%3A00%3A00'
    5     4        ASSIGN_DIM                                               !0, 3
          5        OP_DATA                                                  '2017-08-28+13%3A00%3A00'
    6     6        ASSIGN_DIM                                               !0, 4
          7        OP_DATA                                                  '2017-08-28+12%3A45%3A00'
    7     8        ASSIGN_DIM                                               !0, 5
          9        OP_DATA                                                  '2017-08-28+12%3A30%3A00'
    8    10        ASSIGN_DIM                                               !0, 6
         11        OP_DATA                                                  '2017-08-28+12%3A00%3A00'
   10    12        ASSIGN                                                   !1, 1
         13      > JMP                                                      ->35
   11    14    >   INIT_FCALL                                               'round'
         15        INIT_FCALL                                               'strtotime'
         16        ADD                                              ~10     !1, 1
         17        FETCH_DIM_R                                      ~11     !0, ~10
         18        SEND_VAL                                                 ~11
         19        DO_ICALL                                         $12     
         20        INIT_FCALL                                               'strtotime'
         21        FETCH_DIM_R                                      ~13     !0, !1
         22        SEND_VAL                                                 ~13
         23        DO_ICALL                                         $14     
         24        SUB                                              ~15     $12, $14
         25        DIV                                              ~16     ~15, 3600
         26        SEND_VAL                                                 ~16
         27        SEND_VAL                                                 1
         28        DO_ICALL                                         $17     
         29        ASSIGN                                                   !2, $17
   12    30        NOP                                                      
         31        FAST_CONCAT                                      ~19     'The+difference+is%3A+', !2
         32        CONCAT                                           ~20     ~19, '%0A'
         33        ECHO                                                     ~20
   10    34        PRE_INC                                                  !1
         35    >   COUNT                                            ~22     !0
         36        SUB                                              ~23     ~22, 1
         37        IS_SMALLER_OR_EQUAL                                      !1, ~23
         38      > JMPNZ                                                    ~24, ->14
   13    39    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.39 ms | 1011 KiB | 15 Q