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 = fmod($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 = 97
Branch analysis from position: 97
2 jumps found. (Code = 44) Position 1 = 99, Position 2 = 7
Branch analysis from position: 99
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 = 60
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 88
Branch analysis from position: 88
2 jumps found. (Code = 43) Position 1 = 92, Position 2 = 93
Branch analysis from position: 92
1 jumps found. (Code = 42) Position 1 = 99
Branch analysis from position: 99
Branch analysis from position: 93
2 jumps found. (Code = 44) Position 1 = 99, Position 2 = 7
Branch analysis from position: 99
Branch analysis from position: 7
Branch analysis from position: 60
2 jumps found. (Code = 43) Position 1 = 64, Position 2 = 77
Branch analysis from position: 64
2 jumps found. (Code = 43) Position 1 = 66, Position 2 = 69
Branch analysis from position: 66
1 jumps found. (Code = 42) Position 1 = 76
Branch analysis from position: 76
1 jumps found. (Code = 42) Position 1 = 87
Branch analysis from position: 87
1 jumps found. (Code = 42) Position 1 = 88
Branch analysis from position: 88
Branch analysis from position: 69
1 jumps found. (Code = 42) Position 1 = 87
Branch analysis from position: 87
Branch analysis from position: 77
2 jumps found. (Code = 43) Position 1 = 79, Position 2 = 82
Branch analysis from position: 79
1 jumps found. (Code = 42) Position 1 = 86
Branch analysis from position: 86
1 jumps found. (Code = 42) Position 1 = 88
Branch analysis from position: 88
Branch analysis from position: 82
1 jumps found. (Code = 42) Position 1 = 88
Branch analysis from position: 88
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 41
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 26
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 40
Branch analysis from position: 40
1 jumps found. (Code = 42) Position 1 = 59
Branch analysis from position: 59
1 jumps found. (Code = 42) Position 1 = 88
Branch analysis from position: 88
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 59
Branch analysis from position: 59
Branch analysis from position: 41
2 jumps found. (Code = 43) Position 1 = 43, Position 2 = 46
Branch analysis from position: 43
1 jumps found. (Code = 42) Position 1 = 58
Branch analysis from position: 58
1 jumps found. (Code = 42) Position 1 = 88
Branch analysis from position: 88
Branch analysis from position: 46
1 jumps found. (Code = 42) Position 1 = 88
Branch analysis from position: 88
filename:       /in/QdUi2
function name:  (null)
number of ops:  108
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                                                      ->97
   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, ->60
         12    > > JMP                                                      ->88
   11    13    >   INIT_FCALL                                               'fmod'
         14        SEND_VAR                                                 !0
         15        SEND_VAR                                                 !4
         16        DO_ICALL                                         $15     
         17        ASSIGN                                                   !6, $15
   12    18        ECHO                                                     !6
   13    19        IS_SMALLER                                               !4, !0
         20      > JMPZ                                                     ~17, ->41
   14    21    >   BOOL_NOT                                         ~18     !6
         22      > JMPZ                                                     ~18, ->26
   15    23    >   ASSIGN_DIM                                               !1
         24        OP_DATA                                                  '000'
         25      > JMP                                                      ->40
   17    26    >   SUB                                              ~20     !0, !6
         27        ASSIGN                                                   !0, ~20
   18    28        INIT_FCALL                                               'str_pad'
         29        INIT_FCALL                                               'round'
         30        SEND_VAR                                                 !6
         31        SEND_VAL                                                 2
         32        DO_ICALL                                         $23     
         33        SEND_VAR                                                 $23
         34        SEND_VAL                                                 3
         35        SEND_VAL                                                 '0'
         36        SEND_VAL                                                 0
         37        DO_ICALL                                         $24     
         38        ASSIGN_DIM                                               !1
         39        OP_DATA                                                  $24
         40    > > JMP                                                      ->59
   21    41    >   BOOL_NOT                                         ~25     !6
         42      > JMPZ                                                     ~25, ->46
   22    43    >   ASSIGN_DIM                                               !1
         44        OP_DATA                                                  '000'
         45      > JMP                                                      ->58
   24    46    >   INIT_FCALL                                               'str_pad'
         47        INIT_FCALL                                               'round'
         48        SEND_VAR                                                 !6
         49        SEND_VAL                                                 2
         50        DO_ICALL                                         $28     
         51        SEND_VAR                                                 $28
         52        SEND_VAL                                                 3
         53        SEND_VAL                                                 '0'
         54        SEND_VAL                                                 0
         55        DO_ICALL                                         $29     
         56        ASSIGN_DIM                                               !1
         57        OP_DATA                                                  $29
   26    58    >   ASSIGN                                                   !3, <true>
   28    59    > > JMP                                                      ->88
   29    60    >   MOD                                              ~31     !0, !4
         61        ASSIGN                                                   !6, ~31
   31    62        IS_SMALLER                                               !4, !0
         63      > JMPZ                                                     ~33, ->77
   32    64    >   BOOL_NOT                                         ~34     !6
         65      > JMPZ                                                     ~34, ->69
   33    66    >   ASSIGN_DIM                                               !1
         67        OP_DATA                                                  '00'
         68      > JMP                                                      ->76
   35    69    >   SUB                                              ~36     !0, !6
         70        ASSIGN                                                   !0, ~36
   36    71        ECHO                                                     !6
   37    72        DIV                                              ~39     !4, 100
         73        DIV                                              ~40     !6, ~39
         74        ASSIGN_DIM                                               !1
         75        OP_DATA                                                  ~40
         76    > > JMP                                                      ->87
   40    77    >   BOOL_NOT                                         ~41     !6
         78      > JMPZ                                                     ~41, ->82
   41    79    >   ASSIGN_DIM                                               !1
         80        OP_DATA                                                  '00'
         81      > JMP                                                      ->86
   43    82    >   DIV                                              ~44     !4, 100
         83        DIV                                              ~45     !6, ~44
         84        ASSIGN_DIM                                               !1
         85        OP_DATA                                                  ~45
   46    86    >   ASSIGN                                                   !3, <true>
   48    87    > > JMP                                                      ->88
   50    88    >   INIT_FCALL                                               'print_r'
         89        SEND_VAR                                                 !1
         90        DO_ICALL                                                 
   51    91      > JMPZ                                                     !3, ->93
   52    92    > > JMP                                                      ->99
   54    93    >   MUL                                              ~48     !4, 100
         94        ASSIGN                                                   !4, ~48
    8    95        ADD                                              ~50     !5, 2
         96        ASSIGN                                                   !5, ~50
         97    >   IS_SMALLER                                               !5, 15
         98      > JMPNZ                                                    ~52, ->7
   56    99    >   INIT_FCALL                                               'implode'
        100        SEND_VAL                                                 '%2C'
        101        INIT_FCALL                                               'array_reverse'
        102        SEND_VAR                                                 !1
        103        DO_ICALL                                         $53     
        104        SEND_VAR                                                 $53
        105        DO_ICALL                                         $54     
        106        ECHO                                                     $54
        107      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
195.56 ms | 1408 KiB | 25 Q