3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.83 ms | 1408 KiB | 25 Q