3v4l.org

run code in 300+ PHP versions simultaneously
<?php function timePassed($time){ $time = time() - $time; $tokens = array ( 31536000 => 'year', 2592000 => 'month', 604800 => 'week', 86400 => 'day', 3600 => 'hour', 60 => 'minute', 1 => 'second' ); foreach ($tokens as $unit => $text) { if ($time < $unit) continue; $numberOfUnits = floor($time / $unit); return $numberOfUnits.' '.$text.(($numberOfUnits>1)?'s':''); } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/7SYOB
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E > > RETURN                                                   1

Function timepassed:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 28
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 28
Branch analysis from position: 8
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 12
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 23
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 28
filename:       /in/7SYOB
function name:  timePassed
number of ops:  30
compiled vars:  !0 = $time, !1 = $tokens, !2 = $text, !3 = $unit, !4 = $numberOfUnits
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    3     1        INIT_FCALL                                               'time'
          2        DO_ICALL                                         $5      
          3        SUB                                              ~6      $5, !0
          4        ASSIGN                                                   !0, ~6
    4     5        ASSIGN                                                   !1, <array>
   14     6      > FE_RESET_R                                       $9      !1, ->28
          7    > > FE_FETCH_R                                       ~10     $9, !2, ->28
          8    >   ASSIGN                                                   !3, ~10
   15     9        IS_SMALLER                                               !0, !3
         10      > JMPZ                                                     ~12, ->12
         11    > > JMP                                                      ->7
   16    12    >   INIT_FCALL                                               'floor'
         13        DIV                                              ~13     !0, !3
         14        SEND_VAL                                                 ~13
         15        DO_ICALL                                         $14     
         16        ASSIGN                                                   !4, $14
   17    17        CONCAT                                           ~16     !4, '+'
         18        CONCAT                                           ~17     ~16, !2
         19        IS_SMALLER                                               1, !4
         20      > JMPZ                                                     ~18, ->23
         21    >   QM_ASSIGN                                        ~19     's'
         22      > JMP                                                      ->24
         23    >   QM_ASSIGN                                        ~19     ''
         24    >   CONCAT                                           ~20     ~17, ~19
         25        FE_FREE                                                  $9
         26      > RETURN                                                   ~20
   14    27*       JMP                                                      ->7
         28    >   FE_FREE                                                  $9
   19    29      > RETURN                                                   null

End of function timepassed

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.98 ms | 1400 KiB | 17 Q