3v4l.org

run code in 500+ PHP versions simultaneously
<?php $minutesConverter = function($from,$to,$format='dynamic') { $periods = array('year' => 525600, 'month' => 43800, 'week' => 10080, 'day' => 1440, 'hour' => 60, 'minute' => 1); $output = array(); foreach ($periods as $period_name => $period) { $num_periods = floor($from / $period); if ($num_periods > 1) { $output[] = "$num_periods {$period_name}s"; } elseif ($num_periods > 0) { $output[] = "$num_periods {$period_name}"; } $from -= $num_periods * $period; } return implode(' : ', $output); }; echo $minutesConverter(131390, 0);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qrAIq
function name:  (null)
number of ops:  8
compiled vars:  !0 = $minutesConverter
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   DECLARE_LAMBDA_FUNCTION                              ~1      [0]
          1        ASSIGN                                                       !0, ~1
   24     2        INIT_DYNAMIC_CALL                                            !0
          3        SEND_VAL_EX                                                  131390
          4        SEND_VAL_EX                                                  0
          5        DO_FCALL                                          0  $3      
          6        ECHO                                                         $3
          7      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 32
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 32
Branch analysis from position: 7
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 22
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 22
2 jumps found. (Code = 43) Position 1 = 24, Position 2 = 29
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 29
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
filename:       /in/qrAIq
function name:  {closure:/in/qrAIq:3}
number of ops:  36
compiled vars:  !0 = $from, !1 = $to, !2 = $format, !3 = $periods, !4 = $output, !5 = $period, !6 = $period_name, !7 = $num_periods
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        RECV_INIT                                            !2      'dynamic'
    4     3        ASSIGN                                                       !3, <array>
   10     4        ASSIGN                                                       !4, <array>
   11     5      > FE_RESET_R                                           $10     !3, ->32
          6    > > FE_FETCH_R                                           ~11     $10, !5, ->32
          7    >   ASSIGN                                                       !6, ~11
   12     8        INIT_FCALL                                                   'floor'
          9        DIV                                                  ~13     !0, !5
         10        SEND_VAL                                                     ~13
         11        DO_ICALL                                             $14     
         12        ASSIGN                                                       !7, $14
   13    13        IS_SMALLER                                                   1, !7
         14      > JMPZ                                                         ~16, ->22
   14    15    >   ROPE_INIT                                         4  ~19     !7
         16        ROPE_ADD                                          1  ~19     ~19, '+'
         17        ROPE_ADD                                          2  ~19     ~19, !6
         18        ROPE_END                                          3  ~18     ~19, 's'
         19        ASSIGN_DIM                                                   !4
         20        OP_DATA                                                      ~18
   13    21      > JMP                                                          ->29
   16    22    >   IS_SMALLER                                                   0, !7
         23      > JMPZ                                                         ~21, ->29
   17    24    >   ROPE_INIT                                         3  ~24     !7
         25        ROPE_ADD                                          1  ~24     ~24, '+'
         26        ROPE_END                                          2  ~23     ~24, !6
         27        ASSIGN_DIM                                                   !4
         28        OP_DATA                                                      ~23
   19    29    >   MUL                                                  ~26     !7, !5
         30        ASSIGN_OP                                         2          !0, ~26
   11    31      > JMP                                                          ->6
         32    >   FE_FREE                                                      $10
   21    33        FRAMELESS_ICALL_2                implode             ~28     '+%3A+', !4
         34      > RETURN                                                       ~28
   22    35*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
210.06 ms | 2329 KiB | 14 Q