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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.22 ms | 1408 KiB | 27 Q