3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('SECONDE', 1); define('MINUUT', 60*SECONDE); define('UUR', 60*MINUUT); define('DAG', 24*UUR); // Bezochtte tijd function timetostr($tijd) { $output = ''; $result['dag'] = (int) ($tijd/DAG); $tijd = $tijd % DAG; $result['uur'] = (int) ($tijd/UUR); $tijd = $tijd % UUR; $result['minuut'] = (int) ($tijd/MINUUT); $tijd = $tijd % MINUUT; $result['seconde'] = $tijd; if ($result['dag']) $output[] = $result['dag'] . ($result['dag'] == 1 ? ' dag' : ' dagen'); if ($output || $result['uur']) $output[] = $result['uur'] . ($result['uur'] == 1 ? ' uur' : ' uren'); if ($output || $result['minuut']) $output[] = $result['minuut'] . ($result['minuut'] == 1 ? ' minuut' : ' minuten'); $output[] = $result['seconde'] . ($result['seconde'] == 1 ? ' seconde' : ' seconden'); $return = join($output, ', '); $return = preg_replace('/^(.*), ([^,]+)$/', '\\1 en \\2', $return); return $return; } echo timetostr(164300); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/pH5WE
function name:  (null)
number of ops:  27
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'define'
          1        SEND_VAL                                                 'SECONDE'
          2        SEND_VAL                                                 1
          3        DO_ICALL                                                 
    3     4        INIT_FCALL                                               'define'
          5        SEND_VAL                                                 'MINUUT'
          6        FETCH_CONSTANT                                   ~1      'SECONDE'
          7        MUL                                              ~2      ~1, 60
          8        SEND_VAL                                                 ~2
          9        DO_ICALL                                                 
    4    10        INIT_FCALL                                               'define'
         11        SEND_VAL                                                 'UUR'
         12        FETCH_CONSTANT                                   ~4      'MINUUT'
         13        MUL                                              ~5      ~4, 60
         14        SEND_VAL                                                 ~5
         15        DO_ICALL                                                 
    5    16        INIT_FCALL                                               'define'
         17        SEND_VAL                                                 'DAG'
         18        FETCH_CONSTANT                                   ~7      'UUR'
         19        MUL                                              ~8      ~7, 24
         20        SEND_VAL                                                 ~8
         21        DO_ICALL                                                 
   29    22        INIT_FCALL                                               'timetostr'
         23        SEND_VAL                                                 164300
         24        DO_FCALL                                      0  $10     
         25        ECHO                                                     $10
   30    26      > RETURN                                                   1

Function timetostr:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 40
Branch analysis from position: 30
2 jumps found. (Code = 43) Position 1 = 34, Position 2 = 36
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
2 jumps found. (Code = 47) Position 1 = 41, Position 2 = 43
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 44, Position 2 = 54
Branch analysis from position: 44
2 jumps found. (Code = 43) Position 1 = 48, Position 2 = 50
Branch analysis from position: 48
1 jumps found. (Code = 42) Position 1 = 51
Branch analysis from position: 51
2 jumps found. (Code = 47) Position 1 = 55, Position 2 = 57
Branch analysis from position: 55
2 jumps found. (Code = 43) Position 1 = 58, Position 2 = 68
Branch analysis from position: 58
2 jumps found. (Code = 43) Position 1 = 62, Position 2 = 64
Branch analysis from position: 62
1 jumps found. (Code = 42) Position 1 = 65
Branch analysis from position: 65
2 jumps found. (Code = 43) Position 1 = 72, Position 2 = 74
Branch analysis from position: 72
1 jumps found. (Code = 42) Position 1 = 75
Branch analysis from position: 75
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 74
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 64
2 jumps found. (Code = 43) Position 1 = 72, Position 2 = 74
Branch analysis from position: 72
Branch analysis from position: 74
Branch analysis from position: 68
Branch analysis from position: 57
Branch analysis from position: 50
2 jumps found. (Code = 47) Position 1 = 55, Position 2 = 57
Branch analysis from position: 55
Branch analysis from position: 57
Branch analysis from position: 54
Branch analysis from position: 43
Branch analysis from position: 36
2 jumps found. (Code = 47) Position 1 = 41, Position 2 = 43
Branch analysis from position: 41
Branch analysis from position: 43
Branch analysis from position: 40
filename:       /in/pH5WE
function name:  timetostr
number of ops:  91
compiled vars:  !0 = $tijd, !1 = $output, !2 = $result, !3 = $return
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
    9     1        ASSIGN                                                   !1, ''
   10     2        FETCH_CONSTANT                                   ~6      'DAG'
          3        DIV                                              ~7      !0, ~6
          4        CAST                                          4  ~8      ~7
          5        ASSIGN_DIM                                               !2, 'dag'
          6        OP_DATA                                                  ~8
   11     7        FETCH_CONSTANT                                   ~9      'DAG'
          8        MOD                                              ~10     !0, ~9
          9        ASSIGN                                                   !0, ~10
   12    10        FETCH_CONSTANT                                   ~13     'UUR'
         11        DIV                                              ~14     !0, ~13
         12        CAST                                          4  ~15     ~14
         13        ASSIGN_DIM                                               !2, 'uur'
         14        OP_DATA                                                  ~15
   13    15        FETCH_CONSTANT                                   ~16     'UUR'
         16        MOD                                              ~17     !0, ~16
         17        ASSIGN                                                   !0, ~17
   14    18        FETCH_CONSTANT                                   ~20     'MINUUT'
         19        DIV                                              ~21     !0, ~20
         20        CAST                                          4  ~22     ~21
         21        ASSIGN_DIM                                               !2, 'minuut'
         22        OP_DATA                                                  ~22
   15    23        FETCH_CONSTANT                                   ~23     'MINUUT'
         24        MOD                                              ~24     !0, ~23
         25        ASSIGN                                                   !0, ~24
   16    26        ASSIGN_DIM                                               !2, 'seconde'
         27        OP_DATA                                                  !0
   17    28        FETCH_DIM_R                                      ~27     !2, 'dag'
         29      > JMPZ                                                     ~27, ->40
   18    30    >   FETCH_DIM_R                                      ~29     !2, 'dag'
         31        FETCH_DIM_R                                      ~30     !2, 'dag'
         32        IS_EQUAL                                                 ~30, 1
         33      > JMPZ                                                     ~31, ->36
         34    >   QM_ASSIGN                                        ~32     '+dag'
         35      > JMP                                                      ->37
         36    >   QM_ASSIGN                                        ~32     '+dagen'
         37    >   CONCAT                                           ~33     ~29, ~32
         38        ASSIGN_DIM                                               !1
         39        OP_DATA                                                  ~33
   19    40    > > JMPNZ_EX                                         ~34     !1, ->43
         41    >   FETCH_DIM_R                                      ~35     !2, 'uur'
         42        BOOL                                             ~34     ~35
         43    > > JMPZ                                                     ~34, ->54
   20    44    >   FETCH_DIM_R                                      ~37     !2, 'uur'
         45        FETCH_DIM_R                                      ~38     !2, 'uur'
         46        IS_EQUAL                                                 ~38, 1
         47      > JMPZ                                                     ~39, ->50
         48    >   QM_ASSIGN                                        ~40     '+uur'
         49      > JMP                                                      ->51
         50    >   QM_ASSIGN                                        ~40     '+uren'
         51    >   CONCAT                                           ~41     ~37, ~40
         52        ASSIGN_DIM                                               !1
         53        OP_DATA                                                  ~41
   21    54    > > JMPNZ_EX                                         ~42     !1, ->57
         55    >   FETCH_DIM_R                                      ~43     !2, 'minuut'
         56        BOOL                                             ~42     ~43
         57    > > JMPZ                                                     ~42, ->68
   22    58    >   FETCH_DIM_R                                      ~45     !2, 'minuut'
         59        FETCH_DIM_R                                      ~46     !2, 'minuut'
         60        IS_EQUAL                                                 ~46, 1
         61      > JMPZ                                                     ~47, ->64
         62    >   QM_ASSIGN                                        ~48     '+minuut'
         63      > JMP                                                      ->65
         64    >   QM_ASSIGN                                        ~48     '+minuten'
         65    >   CONCAT                                           ~49     ~45, ~48
         66        ASSIGN_DIM                                               !1
         67        OP_DATA                                                  ~49
   23    68    >   FETCH_DIM_R                                      ~51     !2, 'seconde'
         69        FETCH_DIM_R                                      ~52     !2, 'seconde'
         70        IS_EQUAL                                                 ~52, 1
         71      > JMPZ                                                     ~53, ->74
         72    >   QM_ASSIGN                                        ~54     '+seconde'
         73      > JMP                                                      ->75
         74    >   QM_ASSIGN                                        ~54     '+seconden'
         75    >   CONCAT                                           ~55     ~51, ~54
         76        ASSIGN_DIM                                               !1
         77        OP_DATA                                                  ~55
   24    78        INIT_FCALL                                               'join'
         79        SEND_VAR                                                 !1
         80        SEND_VAL                                                 '%2C+'
         81        DO_ICALL                                         $56     
         82        ASSIGN                                                   !3, $56
   25    83        INIT_FCALL                                               'preg_replace'
         84        SEND_VAL                                                 '%2F%5E%28.%2A%29%2C+%28%5B%5E%2C%5D%2B%29%24%2F'
         85        SEND_VAL                                                 '%5C1+en+%5C2'
         86        SEND_VAR                                                 !3
         87        DO_ICALL                                         $58     
         88        ASSIGN                                                   !3, $58
   26    89      > RETURN                                                   !3
   27    90*     > RETURN                                                   null

End of function timetostr

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.33 ms | 1410 KiB | 20 Q