3v4l.org

run code in 300+ PHP versions simultaneously
<?php function convertTime($starttime){ $time = time() - $starttime; //return $time; $mins = floor($time / 60); return $mins; $hours = floor($mins / 60); $mins = $hours * 60; return ($hours > 0) ? "$hours hrs, $mins mins" : "$mins mins"; } echo convertTime(1412373228);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ej3p4
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_FCALL                                               'converttime'
          1        SEND_VAL                                                 1412373228
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function converttime:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ej3p4
function name:  convertTime
number of ops:  31
compiled vars:  !0 = $starttime, !1 = $time, !2 = $mins, !3 = $hours
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'time'
          2        DO_ICALL                                         $4      
          3        SUB                                              ~5      $4, !0
          4        ASSIGN                                                   !1, ~5
    7     5        INIT_FCALL                                               'floor'
          6        DIV                                              ~7      !1, 60
          7        SEND_VAL                                                 ~7
          8        DO_ICALL                                         $8      
          9        ASSIGN                                                   !2, $8
    8    10      > RETURN                                                   !2
    9    11*       INIT_FCALL                                               'floor'
         12*       DIV                                              ~10     !2, 60
         13*       SEND_VAL                                                 ~10
         14*       DO_ICALL                                         $11     
         15*       ASSIGN                                                   !3, $11
   10    16*       MUL                                              ~13     !3, 60
         17*       ASSIGN                                                   !2, ~13
   11    18*       IS_SMALLER                                               0, !3
         19*       JMPZ                                                     ~15, ->26
         20*       ROPE_INIT                                     4  ~17     !3
         21*       ROPE_ADD                                      1  ~17     ~17, '+hrs%2C+'
         22*       ROPE_ADD                                      2  ~17     ~17, !2
         23*       ROPE_END                                      3  ~16     ~17, '+mins'
         24*       QM_ASSIGN                                        ~19     ~16
         25*       JMP                                                      ->29
         26*       NOP                                                      
         27*       FAST_CONCAT                                      ~20     !2, '+mins'
         28*       QM_ASSIGN                                        ~19     ~20
         29*       RETURN                                                   ~19
   12    30*     > RETURN                                                   null

End of function converttime

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.24 ms | 1398 KiB | 18 Q