3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.02 ms | 1409 KiB | 25 Q