3v4l.org

run code in 300+ PHP versions simultaneously
<?php //$amount = number_format(9.22337203685E+18,0,'',''); $amount = 9223372036850000000; $number_sep = array(); $multi = 1; $exit = false; $i = 1000; for($j=3;$j < 15 ;$j=$j+2) { switch($j) { case 3: $temp = $amount%$i; echo $temp; if($i < $amount) { if(!$temp) { $number_sep[] = '000'; } else { $amount = $amount - $temp; $number_sep[] = str_pad(round($temp,2),3,'0',STR_PAD_LEFT); } } else { if(!$temp) { $number_sep[] = '000'; } else { $number_sep[] = str_pad(round($temp,2),3,'0',STR_PAD_LEFT); } $exit = true; } break; case $j > 3 : $temp = $amount % $i; if($i < $amount) { if(!$temp) { $number_sep[] = '00'; } else { $amount = $amount - $temp; echo $temp; $number_sep[] = $temp/($i/100); } } else { if(!$temp) { $number_sep[] = '00'; } else { $number_sep[] = $temp/($i/100); } $exit = true; }; break; } print_r($number_sep); if($exit) { break; } $i = 10 * 10 * $i; } echo implode(',',array_reverse($number_sep));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 94
Branch analysis from position: 94
2 jumps found. (Code = 44) Position 1 = 96, Position 2 = 7
Branch analysis from position: 96
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
2 jumps found. (Code = 44) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 12, Position 2 = 57
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 85
Branch analysis from position: 85
2 jumps found. (Code = 43) Position 1 = 89, Position 2 = 90
Branch analysis from position: 89
1 jumps found. (Code = 42) Position 1 = 96
Branch analysis from position: 96
Branch analysis from position: 90
2 jumps found. (Code = 44) Position 1 = 96, Position 2 = 7
Branch analysis from position: 96
Branch analysis from position: 7
Branch analysis from position: 57
2 jumps found. (Code = 43) Position 1 = 61, Position 2 = 74
Branch analysis from position: 61
2 jumps found. (Code = 43) Position 1 = 63, Position 2 = 66
Branch analysis from position: 63
1 jumps found. (Code = 42) Position 1 = 73
Branch analysis from position: 73
1 jumps found. (Code = 42) Position 1 = 84
Branch analysis from position: 84
1 jumps found. (Code = 42) Position 1 = 85
Branch analysis from position: 85
Branch analysis from position: 66
1 jumps found. (Code = 42) Position 1 = 84
Branch analysis from position: 84
Branch analysis from position: 74
2 jumps found. (Code = 43) Position 1 = 76, Position 2 = 79
Branch analysis from position: 76
1 jumps found. (Code = 42) Position 1 = 83
Branch analysis from position: 83
1 jumps found. (Code = 42) Position 1 = 85
Branch analysis from position: 85
Branch analysis from position: 79
1 jumps found. (Code = 42) Position 1 = 85
Branch analysis from position: 85
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 38
Branch analysis from position: 18
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 23
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 56
Branch analysis from position: 56
1 jumps found. (Code = 42) Position 1 = 85
Branch analysis from position: 85
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 56
Branch analysis from position: 56
Branch analysis from position: 38
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 43
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 55
Branch analysis from position: 55
1 jumps found. (Code = 42) Position 1 = 85
Branch analysis from position: 85
Branch analysis from position: 43
1 jumps found. (Code = 42) Position 1 = 85
Branch analysis from position: 85
filename:       /in/HPMji
function name:  (null)
number of ops:  105
compiled vars:  !0 = $amount, !1 = $number_sep, !2 = $multi, !3 = $exit, !4 = $i, !5 = $j, !6 = $temp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 9223372036850000000
    4     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN                                                   !2, 1
    6     3        ASSIGN                                                   !3, <false>
    7     4        ASSIGN                                                   !4, 1000
    8     5        ASSIGN                                                   !5, 3
          6      > JMP                                                      ->94
   11     7    >   IS_EQUAL                                                 !5, 3
          8      > JMPNZ                                                    ~13, ->13
   29     9    >   IS_SMALLER                                       ~14     3, !5
         10        IS_EQUAL                                                 !5, ~14
         11      > JMPNZ                                                    ~13, ->57
         12    > > JMP                                                      ->85
   11    13    >   MOD                                              ~15     !0, !4
         14        ASSIGN                                                   !6, ~15
   12    15        ECHO                                                     !6
   13    16        IS_SMALLER                                               !4, !0
         17      > JMPZ                                                     ~17, ->38
   14    18    >   BOOL_NOT                                         ~18     !6
         19      > JMPZ                                                     ~18, ->23
   15    20    >   ASSIGN_DIM                                               !1
         21        OP_DATA                                                  '000'
         22      > JMP                                                      ->37
   17    23    >   SUB                                              ~20     !0, !6
         24        ASSIGN                                                   !0, ~20
   18    25        INIT_FCALL                                               'str_pad'
         26        INIT_FCALL                                               'round'
         27        SEND_VAR                                                 !6
         28        SEND_VAL                                                 2
         29        DO_ICALL                                         $23     
         30        SEND_VAR                                                 $23
         31        SEND_VAL                                                 3
         32        SEND_VAL                                                 '0'
         33        SEND_VAL                                                 0
         34        DO_ICALL                                         $24     
         35        ASSIGN_DIM                                               !1
         36        OP_DATA                                                  $24
         37    > > JMP                                                      ->56
   21    38    >   BOOL_NOT                                         ~25     !6
         39      > JMPZ                                                     ~25, ->43
   22    40    >   ASSIGN_DIM                                               !1
         41        OP_DATA                                                  '000'
         42      > JMP                                                      ->55
   24    43    >   INIT_FCALL                                               'str_pad'
         44        INIT_FCALL                                               'round'
         45        SEND_VAR                                                 !6
         46        SEND_VAL                                                 2
         47        DO_ICALL                                         $28     
         48        SEND_VAR                                                 $28
         49        SEND_VAL                                                 3
         50        SEND_VAL                                                 '0'
         51        SEND_VAL                                                 0
         52        DO_ICALL                                         $29     
         53        ASSIGN_DIM                                               !1
         54        OP_DATA                                                  $29
   26    55    >   ASSIGN                                                   !3, <true>
   28    56    > > JMP                                                      ->85
   29    57    >   MOD                                              ~31     !0, !4
         58        ASSIGN                                                   !6, ~31
   31    59        IS_SMALLER                                               !4, !0
         60      > JMPZ                                                     ~33, ->74
   32    61    >   BOOL_NOT                                         ~34     !6
         62      > JMPZ                                                     ~34, ->66
   33    63    >   ASSIGN_DIM                                               !1
         64        OP_DATA                                                  '00'
         65      > JMP                                                      ->73
   35    66    >   SUB                                              ~36     !0, !6
         67        ASSIGN                                                   !0, ~36
   36    68        ECHO                                                     !6
   37    69        DIV                                              ~39     !4, 100
         70        DIV                                              ~40     !6, ~39
         71        ASSIGN_DIM                                               !1
         72        OP_DATA                                                  ~40
         73    > > JMP                                                      ->84
   40    74    >   BOOL_NOT                                         ~41     !6
         75      > JMPZ                                                     ~41, ->79
   41    76    >   ASSIGN_DIM                                               !1
         77        OP_DATA                                                  '00'
         78      > JMP                                                      ->83
   43    79    >   DIV                                              ~44     !4, 100
         80        DIV                                              ~45     !6, ~44
         81        ASSIGN_DIM                                               !1
         82        OP_DATA                                                  ~45
   46    83    >   ASSIGN                                                   !3, <true>
   48    84    > > JMP                                                      ->85
   50    85    >   INIT_FCALL                                               'print_r'
         86        SEND_VAR                                                 !1
         87        DO_ICALL                                                 
   51    88      > JMPZ                                                     !3, ->90
   52    89    > > JMP                                                      ->96
   54    90    >   MUL                                              ~48     !4, 100
         91        ASSIGN                                                   !4, ~48
    8    92        ADD                                              ~50     !5, 2
         93        ASSIGN                                                   !5, ~50
         94    >   IS_SMALLER                                               !5, 15
         95      > JMPNZ                                                    ~52, ->7
   56    96    >   INIT_FCALL                                               'implode'
         97        SEND_VAL                                                 '%2C'
         98        INIT_FCALL                                               'array_reverse'
         99        SEND_VAR                                                 !1
        100        DO_ICALL                                         $53     
        101        SEND_VAR                                                 $53
        102        DO_ICALL                                         $54     
        103        ECHO                                                     $54
        104      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.55 ms | 1404 KiB | 23 Q