3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dailyHours = 7.5; $baseDate = new DateTime('2017-01-01', new DateTimezone('UTC')); $endDate = clone $baseDate; for($i = 1; $i <= 30; ++$i) { $m = $i*15; $duration = new DateInterval("PT{$m}M"); $endDate->add($duration); } $totalDuration = $baseDate->diff($endDate); echo $totalDuration->format('%a days, %h hours, %i minutes'); $totalHours = $totalDuration->format('%a') * 7.5 + $totalDuration->format('%h'); $totalMinutes = $totalDuration->format('%i'); var_dump($totalHours, $totalMinutes);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 13
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 13
Branch analysis from position: 28
Branch analysis from position: 13
filename:       /in/opRWT
function name:  (null)
number of ops:  54
compiled vars:  !0 = $dailyHours, !1 = $baseDate, !2 = $endDate, !3 = $i, !4 = $m, !5 = $duration, !6 = $totalDuration, !7 = $totalHours, !8 = $totalMinutes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 7.5
    5     1        NEW                                              $10     'DateTime'
          2        SEND_VAL_EX                                              '2017-01-01'
          3        NEW                                              $11     'DateTimezone'
          4        SEND_VAL_EX                                              'UTC'
          5        DO_FCALL                                      0          
          6        SEND_VAR_NO_REF_EX                                       $11
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !1, $10
    6     9        CLONE                                            ~15     !1
         10        ASSIGN                                                   !2, ~15
    7    11        ASSIGN                                                   !3, 1
         12      > JMP                                                      ->26
    8    13    >   MUL                                              ~18     !3, 15
         14        ASSIGN                                                   !4, ~18
    9    15        NEW                                              $20     'DateInterval'
         16        ROPE_INIT                                     3  ~22     'PT'
         17        ROPE_ADD                                      1  ~22     ~22, !4
         18        ROPE_END                                      2  ~21     ~22, 'M'
         19        SEND_VAL_EX                                              ~21
         20        DO_FCALL                                      0          
         21        ASSIGN                                                   !5, $20
   10    22        INIT_METHOD_CALL                                         !2, 'add'
         23        SEND_VAR_EX                                              !5
         24        DO_FCALL                                      0          
    7    25        PRE_INC                                                  !3
         26    >   IS_SMALLER_OR_EQUAL                                      !3, 30
         27      > JMPNZ                                                    ~28, ->13
   13    28    >   INIT_METHOD_CALL                                         !1, 'diff'
         29        SEND_VAR_EX                                              !2
         30        DO_FCALL                                      0  $29     
         31        ASSIGN                                                   !6, $29
   15    32        INIT_METHOD_CALL                                         !6, 'format'
         33        SEND_VAL_EX                                              '%25a+days%2C+%25h+hours%2C+%25i+minutes'
         34        DO_FCALL                                      0  $31     
         35        ECHO                                                     $31
   16    36        INIT_METHOD_CALL                                         !6, 'format'
         37        SEND_VAL_EX                                              '%25a'
         38        DO_FCALL                                      0  $32     
         39        MUL                                              ~33     $32, 7.5
         40        INIT_METHOD_CALL                                         !6, 'format'
         41        SEND_VAL_EX                                              '%25h'
         42        DO_FCALL                                      0  $34     
         43        ADD                                              ~35     ~33, $34
         44        ASSIGN                                                   !7, ~35
   17    45        INIT_METHOD_CALL                                         !6, 'format'
         46        SEND_VAL_EX                                              '%25i'
         47        DO_FCALL                                      0  $37     
         48        ASSIGN                                                   !8, $37
   19    49        INIT_FCALL                                               'var_dump'
         50        SEND_VAR                                                 !7
         51        SEND_VAR                                                 !8
         52        DO_ICALL                                                 
         53      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.76 ms | 941 KiB | 16 Q