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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.04 ms | 1404 KiB | 25 Q