3v4l.org

run code in 300+ PHP versions simultaneously
<?php $amount = 12302342340; $number_sep = array(); $multi = 1; $exit = false; $i = 1000; for($j=3;$j < 10 ;$j=$j+2) { switch($j) { case 3: $temp = $amount % $i; if($i < $amount) { if(!$temp) { $number_sep[] = $i; } else { $amount = $amount - $temp; $number_sep[] = $temp; } } else { if(!$temp) { $number_sep[] = $i; } else { $number_sep[] = $temp; } $exit = true; } break; case $j > 3 : $temp = $amount % $i; if($i < $amount) { if(!$temp) { $number_sep[] = $i; } else { $amount = $amount - $temp; $number_sep[] = substr($temp, 0, 2); } } else { if(!$temp) { $number_sep[] = $i; } else { $number_sep[] = substr($temp, 0, 2); } $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 = 75
Branch analysis from position: 75
2 jumps found. (Code = 44) Position 1 = 77, Position 2 = 7
Branch analysis from position: 77
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 = 36
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 69
Branch analysis from position: 69
2 jumps found. (Code = 43) Position 1 = 70, Position 2 = 71
Branch analysis from position: 70
1 jumps found. (Code = 42) Position 1 = 77
Branch analysis from position: 77
Branch analysis from position: 71
2 jumps found. (Code = 44) Position 1 = 77, Position 2 = 7
Branch analysis from position: 77
Branch analysis from position: 7
Branch analysis from position: 36
2 jumps found. (Code = 43) Position 1 = 40, Position 2 = 55
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 = 54
Branch analysis from position: 54
1 jumps found. (Code = 42) Position 1 = 68
Branch analysis from position: 68
1 jumps found. (Code = 42) Position 1 = 69
Branch analysis from position: 69
Branch analysis from position: 45
1 jumps found. (Code = 42) Position 1 = 68
Branch analysis from position: 68
Branch analysis from position: 55
2 jumps found. (Code = 43) Position 1 = 57, Position 2 = 60
Branch analysis from position: 57
1 jumps found. (Code = 42) Position 1 = 67
Branch analysis from position: 67
1 jumps found. (Code = 42) Position 1 = 69
Branch analysis from position: 69
Branch analysis from position: 60
1 jumps found. (Code = 42) Position 1 = 69
Branch analysis from position: 69
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 27
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 22
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
1 jumps found. (Code = 42) Position 1 = 69
Branch analysis from position: 69
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 35
Branch analysis from position: 35
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 = 34
Branch analysis from position: 34
1 jumps found. (Code = 42) Position 1 = 69
Branch analysis from position: 69
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 69
Branch analysis from position: 69
filename:       /in/E7pjm
function name:  (null)
number of ops:  86
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, 12302342340
    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                                                      ->75
   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, ->36
         12    > > JMP                                                      ->69
   10    13    >   MOD                                              ~15     !0, !4
         14        ASSIGN                                                   !6, ~15
   12    15        IS_SMALLER                                               !4, !0
         16      > JMPZ                                                     ~17, ->27
   13    17    >   BOOL_NOT                                         ~18     !6
         18      > JMPZ                                                     ~18, ->22
   14    19    >   ASSIGN_DIM                                               !1
         20        OP_DATA                                                  !4
         21      > JMP                                                      ->26
   16    22    >   SUB                                              ~20     !0, !6
         23        ASSIGN                                                   !0, ~20
   17    24        ASSIGN_DIM                                               !1
         25        OP_DATA                                                  !6
         26    > > JMP                                                      ->35
   20    27    >   BOOL_NOT                                         ~23     !6
         28      > JMPZ                                                     ~23, ->32
   21    29    >   ASSIGN_DIM                                               !1
         30        OP_DATA                                                  !4
         31      > JMP                                                      ->34
   23    32    >   ASSIGN_DIM                                               !1
         33        OP_DATA                                                  !6
   25    34    >   ASSIGN                                                   !3, <true>
   27    35    > > JMP                                                      ->69
   28    36    >   MOD                                              ~27     !0, !4
         37        ASSIGN                                                   !6, ~27
   30    38        IS_SMALLER                                               !4, !0
         39      > JMPZ                                                     ~29, ->55
   31    40    >   BOOL_NOT                                         ~30     !6
         41      > JMPZ                                                     ~30, ->45
   32    42    >   ASSIGN_DIM                                               !1
         43        OP_DATA                                                  !4
         44      > JMP                                                      ->54
   34    45    >   SUB                                              ~32     !0, !6
         46        ASSIGN                                                   !0, ~32
   35    47        INIT_FCALL                                               'substr'
         48        SEND_VAR                                                 !6
         49        SEND_VAL                                                 0
         50        SEND_VAL                                                 2
         51        DO_ICALL                                         $35     
         52        ASSIGN_DIM                                               !1
         53        OP_DATA                                                  $35
         54    > > JMP                                                      ->68
   38    55    >   BOOL_NOT                                         ~36     !6
         56      > JMPZ                                                     ~36, ->60
   39    57    >   ASSIGN_DIM                                               !1
         58        OP_DATA                                                  !4
         59      > JMP                                                      ->67
   41    60    >   INIT_FCALL                                               'substr'
         61        SEND_VAR                                                 !6
         62        SEND_VAL                                                 0
         63        SEND_VAL                                                 2
         64        DO_ICALL                                         $39     
         65        ASSIGN_DIM                                               !1
         66        OP_DATA                                                  $39
   43    67    >   ASSIGN                                                   !3, <true>
   45    68    > > JMP                                                      ->69
   48    69    > > JMPZ                                                     !3, ->71
   49    70    > > JMP                                                      ->77
   51    71    >   MUL                                              ~41     !4, 100
         72        ASSIGN                                                   !4, ~41
    7    73        ADD                                              ~43     !5, 2
         74        ASSIGN                                                   !5, ~43
         75    >   IS_SMALLER                                               !5, 10
         76      > JMPNZ                                                    ~45, ->7
   53    77    >   INIT_FCALL                                               'implode'
         78        SEND_VAL                                                 '%2C'
         79        INIT_FCALL                                               'array_reverse'
         80        SEND_VAR                                                 !1
         81        DO_ICALL                                         $46     
         82        SEND_VAR                                                 $46
         83        DO_ICALL                                         $47     
         84        ECHO                                                     $47
         85      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.78 ms | 1404 KiB | 19 Q