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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.46 ms | 1408 KiB | 25 Q