3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.26 ms | 1404 KiB | 23 Q