3v4l.org

run code in 300+ PHP versions simultaneously
<?php function add($first, $second) { $firstParsed = date_parse($first); $secondParsed = date_parse($second); $firstTotalMinutes = $firstParsed['hour'] * 60 + $firstParsed['minute']; $secondTotalMinutes = $secondParsed['hour'] * 60 + $secondParsed['minute']; $totalMinutes = $firstTotalMinutes + $secondTotalMinutes; $hours = (int)($totalMinutes / 60); $minutes = $totalMinutes % 60; return sprintf('%02d:%02d', $hours, $minutes); } echo add('01:30', '05:30');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OEd38
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'add'
          1        SEND_VAL                                                 '01%3A30'
          2        SEND_VAL                                                 '05%3A30'
          3        DO_FCALL                                      0  $0      
          4        ECHO                                                     $0
          5      > RETURN                                                   1

Function add:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OEd38
function name:  add
number of ops:  34
compiled vars:  !0 = $first, !1 = $second, !2 = $firstParsed, !3 = $secondParsed, !4 = $firstTotalMinutes, !5 = $secondTotalMinutes, !6 = $totalMinutes, !7 = $hours, !8 = $minutes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    4     2        INIT_FCALL                                               'date_parse'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $9      
          5        ASSIGN                                                   !2, $9
    5     6        INIT_FCALL                                               'date_parse'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                         $11     
          9        ASSIGN                                                   !3, $11
    7    10        FETCH_DIM_R                                      ~13     !2, 'hour'
         11        MUL                                              ~14     ~13, 60
         12        FETCH_DIM_R                                      ~15     !2, 'minute'
         13        ADD                                              ~16     ~14, ~15
         14        ASSIGN                                                   !4, ~16
    8    15        FETCH_DIM_R                                      ~18     !3, 'hour'
         16        MUL                                              ~19     ~18, 60
         17        FETCH_DIM_R                                      ~20     !3, 'minute'
         18        ADD                                              ~21     ~19, ~20
         19        ASSIGN                                                   !5, ~21
   10    20        ADD                                              ~23     !4, !5
         21        ASSIGN                                                   !6, ~23
   11    22        DIV                                              ~25     !6, 60
         23        CAST                                          4  ~26     ~25
         24        ASSIGN                                                   !7, ~26
   12    25        MOD                                              ~28     !6, 60
         26        ASSIGN                                                   !8, ~28
   14    27        INIT_FCALL                                               'sprintf'
         28        SEND_VAL                                                 '%2502d%3A%2502d'
         29        SEND_VAR                                                 !7
         30        SEND_VAR                                                 !8
         31        DO_ICALL                                         $30     
         32      > RETURN                                                   $30
   15    33*     > RETURN                                                   null

End of function add

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.73 ms | 1403 KiB | 18 Q