3v4l.org

run code in 300+ PHP versions simultaneously
<?php $date1 = date_create("12:45:00"); $date2 = date_create("11:00:00"); $diff=date_diff($date1,$date2); echo "Difference in Hours\n"; echo $diff->format("%R%H hours")."\n"; echo "Difference in Minutes\n"; echo $diff->format("%R%i minutes");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1vrjn
function name:  (null)
number of ops:  25
compiled vars:  !0 = $date1, !1 = $date2, !2 = $diff
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'date_create'
          1        SEND_VAL                                                 '12%3A45%3A00'
          2        DO_ICALL                                         $3      
          3        ASSIGN                                                   !0, $3
    4     4        INIT_FCALL                                               'date_create'
          5        SEND_VAL                                                 '11%3A00%3A00'
          6        DO_ICALL                                         $5      
          7        ASSIGN                                                   !1, $5
    6     8        INIT_FCALL                                               'date_diff'
          9        SEND_VAR                                                 !0
         10        SEND_VAR                                                 !1
         11        DO_ICALL                                         $7      
         12        ASSIGN                                                   !2, $7
    7    13        ECHO                                                     'Difference+in+Hours%0A'
    8    14        INIT_METHOD_CALL                                         !2, 'format'
         15        SEND_VAL_EX                                              '%25R%25H+hours'
         16        DO_FCALL                                      0  $9      
         17        CONCAT                                           ~10     $9, '%0A'
         18        ECHO                                                     ~10
    9    19        ECHO                                                     'Difference+in+Minutes%0A'
   10    20        INIT_METHOD_CALL                                         !2, 'format'
         21        SEND_VAL_EX                                              '%25R%25i+minutes'
         22        DO_FCALL                                      0  $11     
         23        ECHO                                                     $11
         24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
128.12 ms | 1399 KiB | 17 Q