3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
173.82 ms | 1404 KiB | 25 Q