3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.81 ms | 1396 KiB | 25 Q