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);echo $temp;$temp = round(($temp - floor($temp)) * 1000,2); 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[] = round($temp/($i/100),0); } } else { if(!$temp) { $number_sep[] = '00'; } else { $number_sep[] = round($temp/($i/100),0); } $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 = 112
Branch analysis from position: 112
2 jumps found. (Code = 44) Position 1 = 114, Position 2 = 7
Branch analysis from position: 114
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 = 103
Branch analysis from position: 103
2 jumps found. (Code = 43) Position 1 = 107, Position 2 = 108
Branch analysis from position: 107
1 jumps found. (Code = 42) Position 1 = 114
Branch analysis from position: 114
Branch analysis from position: 108
2 jumps found. (Code = 44) Position 1 = 114, Position 2 = 7
Branch analysis from position: 114
Branch analysis from position: 7
Branch analysis from position: 67
2 jumps found. (Code = 43) Position 1 = 71, Position 2 = 88
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 = 87
Branch analysis from position: 87
1 jumps found. (Code = 42) Position 1 = 102
Branch analysis from position: 102
1 jumps found. (Code = 42) Position 1 = 103
Branch analysis from position: 103
Branch analysis from position: 76
1 jumps found. (Code = 42) Position 1 = 102
Branch analysis from position: 102
Branch analysis from position: 88
2 jumps found. (Code = 43) Position 1 = 90, Position 2 = 93
Branch analysis from position: 90
1 jumps found. (Code = 42) Position 1 = 101
Branch analysis from position: 101
1 jumps found. (Code = 42) Position 1 = 103
Branch analysis from position: 103
Branch analysis from position: 93
1 jumps found. (Code = 42) Position 1 = 103
Branch analysis from position: 103
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 = 103
Branch analysis from position: 103
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 = 103
Branch analysis from position: 103
Branch analysis from position: 53
1 jumps found. (Code = 42) Position 1 = 103
Branch analysis from position: 103
filename:       /in/gjFHg
function name:  (null)
number of ops:  123
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                                                      ->112
   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                                                      ->103
   11    13    >   DIV                                              ~15     !0, !4
         14        ASSIGN                                                   !6, ~15
         15        ECHO                                                     !6
         16        INIT_FCALL                                               'round'
         17        INIT_FCALL                                               'floor'
         18        SEND_VAR                                                 !6
         19        DO_ICALL                                         $17     
         20        SUB                                              ~18     !6, $17
         21        MUL                                              ~19     ~18, 1000
         22        SEND_VAL                                                 ~19
         23        SEND_VAL                                                 2
         24        DO_ICALL                                         $20     
         25        ASSIGN                                                   !6, $20
   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                                                      ->103
   29    67    >   MOD                                              ~36     !0, !4
         68        ASSIGN                                                   !6, ~36
   31    69        IS_SMALLER                                               !4, !0
         70      > JMPZ                                                     ~38, ->88
   32    71    >   BOOL_NOT                                         ~39     !6
         72      > JMPZ                                                     ~39, ->76
   33    73    >   ASSIGN_DIM                                               !1
         74        OP_DATA                                                  '00'
         75      > JMP                                                      ->87
   35    76    >   SUB                                              ~41     !0, !6
         77        ASSIGN                                                   !0, ~41
   36    78        ECHO                                                     !6
   37    79        INIT_FCALL                                               'round'
         80        DIV                                              ~44     !4, 100
         81        DIV                                              ~45     !6, ~44
         82        SEND_VAL                                                 ~45
         83        SEND_VAL                                                 0
         84        DO_ICALL                                         $46     
         85        ASSIGN_DIM                                               !1
         86        OP_DATA                                                  $46
         87    > > JMP                                                      ->102
   40    88    >   BOOL_NOT                                         ~47     !6
         89      > JMPZ                                                     ~47, ->93
   41    90    >   ASSIGN_DIM                                               !1
         91        OP_DATA                                                  '00'
         92      > JMP                                                      ->101
   43    93    >   INIT_FCALL                                               'round'
         94        DIV                                              ~50     !4, 100
         95        DIV                                              ~51     !6, ~50
         96        SEND_VAL                                                 ~51
         97        SEND_VAL                                                 0
         98        DO_ICALL                                         $52     
         99        ASSIGN_DIM                                               !1
        100        OP_DATA                                                  $52
   46   101    >   ASSIGN                                                   !3, <true>
   48   102    > > JMP                                                      ->103
   50   103    >   INIT_FCALL                                               'print_r'
        104        SEND_VAR                                                 !1
        105        DO_ICALL                                                 
   51   106      > JMPZ                                                     !3, ->108
   52   107    > > JMP                                                      ->114
   54   108    >   MUL                                              ~55     !4, 100
        109        ASSIGN                                                   !4, ~55
    8   110        ADD                                              ~57     !5, 2
        111        ASSIGN                                                   !5, ~57
        112    >   IS_SMALLER                                               !5, 15
        113      > JMPNZ                                                    ~59, ->7
   56   114    >   INIT_FCALL                                               'implode'
        115        SEND_VAL                                                 '%2C'
        116        INIT_FCALL                                               'array_reverse'
        117        SEND_VAR                                                 !1
        118        DO_ICALL                                         $60     
        119        SEND_VAR                                                 $60
        120        DO_ICALL                                         $61     
        121        ECHO                                                     $61
        122      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.05 ms | 1400 KiB | 25 Q