3v4l.org

run code in 500+ PHP versions simultaneously
<?php error_reporting(-1); $amount = 54500; $amountInAtm = 0; $bills = array( 5000 => 200, 1000 => 0, 500 => 0, 100 => 0, ); foreach ($bills as $key => $value) { $amountInAtm += $key * $value; } if ($amount > $amountInAtm){ echo "Выдача невозможна: в банкомате недостаточно купюр"; exit(); } elseif ($amount <= 0){ echo "Выдача невозможна: требуемая сумма больше или равна 0"; exit(); } elseif ($amount % 100 != 0){ echo "Выдача невозможна: требуемая сумма не кратка 100"; exit(); } echo "Сумма: $amount\n"; $billsForDelivery = array( 5000 => 0, 1000 => 0, 500 => 0, 100 => 0, ); foreach ($bills as $key => $value) { while ($key <= $amount){ $billsForDelivery[$key]++; $amount -= $key; } } echo "Выдача возможна, число купюр:\n"; foreach ($billsForDelivery as $key => $value) { echo "{$value}x{$key} "; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 12
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 12
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 12
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 19
Branch analysis from position: 15
1 jumps found. (Code = 61) Position 1 = -2
Branch analysis from position: 19
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 25
Branch analysis from position: 21
1 jumps found. (Code = 61) Position 1 = -2
Branch analysis from position: 25
2 jumps found. (Code = 43) Position 1 = 28, Position 2 = 31
Branch analysis from position: 28
1 jumps found. (Code = 61) Position 1 = -2
Branch analysis from position: 31
2 jumps found. (Code = 77) Position 1 = 37, Position 2 = 46
Branch analysis from position: 37
2 jumps found. (Code = 78) Position 1 = 38, Position 2 = 46
Branch analysis from position: 38
1 jumps found. (Code = 42) Position 1 = 43
Branch analysis from position: 43
2 jumps found. (Code = 44) Position 1 = 45, Position 2 = 40
Branch analysis from position: 45
1 jumps found. (Code = 42) Position 1 = 37
Branch analysis from position: 37
Branch analysis from position: 40
2 jumps found. (Code = 44) Position 1 = 45, Position 2 = 40
Branch analysis from position: 45
Branch analysis from position: 40
Branch analysis from position: 46
2 jumps found. (Code = 77) Position 1 = 49, Position 2 = 57
Branch analysis from position: 49
2 jumps found. (Code = 78) Position 1 = 50, Position 2 = 57
Branch analysis from position: 50
1 jumps found. (Code = 42) Position 1 = 49
Branch analysis from position: 49
Branch analysis from position: 57
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 57
Branch analysis from position: 46
Branch analysis from position: 12
filename:       /in/LHVOQ
function name:  (null)
number of ops:  59
compiled vars:  !0 = $amount, !1 = $amountInAtm, !2 = $bills, !3 = $value, !4 = $key, !5 = $billsForDelivery
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                                   'error_reporting'
          1        SEND_VAL                                                     -1
          2        DO_ICALL                                                     
    5     3        ASSIGN                                                       !0, 54500
    6     4        ASSIGN                                                       !1, 0
    7     5        ASSIGN                                                       !2, <array>
   14     6      > FE_RESET_R                                           $10     !2, ->12
          7    > > FE_FETCH_R                                           ~11     $10, !3, ->12
          8    >   ASSIGN                                                       !4, ~11
   15     9        MUL                                                  ~13     !4, !3
         10        ASSIGN_OP                                         1          !1, ~13
   14    11      > JMP                                                          ->7
         12    >   FE_FREE                                                      $10
   18    13        IS_SMALLER                                                   !1, !0
         14      > JMPZ                                                         ~15, ->19
   19    15    >   ECHO                                                         '%D0%92%D1%8B%D0%B4%D0%B0%D1%87%D0%B0+%D0%BD%D0%B5%D0%B2%D0%BE%D0%B7%D0%BC%D0%BE%D0%B6%D0%BD%D0%B0%3A+%D0%B2+%D0%B1%D0%B0%D0%BD%D0%BA%D0%BE%D0%BC%D0%B0%D1%82%D0%B5+%D0%BD%D0%B5%D0%B4%D0%BE%D1%81%D1%82%D0%B0%D1%82%D0%BE%D1%87%D0%BD%D0%BE+%D0%BA%D1%83%D0%BF%D1%8E%D1%80'
   20    16      > INIT_FCALL                                                   'exit'
         17*       DO_ICALL                                                     
   18    18*       JMP                                                          ->31
   21    19    >   IS_SMALLER_OR_EQUAL                                          !0, 0
         20      > JMPZ                                                         ~17, ->25
   22    21    >   ECHO                                                         '%D0%92%D1%8B%D0%B4%D0%B0%D1%87%D0%B0+%D0%BD%D0%B5%D0%B2%D0%BE%D0%B7%D0%BC%D0%BE%D0%B6%D0%BD%D0%B0%3A+%D1%82%D1%80%D0%B5%D0%B1%D1%83%D0%B5%D0%BC%D0%B0%D1%8F+%D1%81%D1%83%D0%BC%D0%BC%D0%B0+%D0%B1%D0%BE%D0%BB%D1%8C%D1%88%D0%B5+%D0%B8%D0%BB%D0%B8+%D1%80%D0%B0%D0%B2%D0%BD%D0%B0+0'
   23    22      > INIT_FCALL                                                   'exit'
         23*       DO_ICALL                                                     
   21    24*       JMP                                                          ->31
   24    25    >   MOD                                                  ~19     !0, 100
         26        IS_NOT_EQUAL                                                 ~19, 0
         27      > JMPZ                                                         ~20, ->31
   25    28    >   ECHO                                                         '%D0%92%D1%8B%D0%B4%D0%B0%D1%87%D0%B0+%D0%BD%D0%B5%D0%B2%D0%BE%D0%B7%D0%BC%D0%BE%D0%B6%D0%BD%D0%B0%3A+%D1%82%D1%80%D0%B5%D0%B1%D1%83%D0%B5%D0%BC%D0%B0%D1%8F+%D1%81%D1%83%D0%BC%D0%BC%D0%B0+%D0%BD%D0%B5+%D0%BA%D1%80%D0%B0%D1%82%D0%BA%D0%B0+100'
   26    29      > INIT_FCALL                                                   'exit'
         30*       DO_ICALL                                                     
   29    31    >   ROPE_INIT                                         3  ~23     '%D0%A1%D1%83%D0%BC%D0%BC%D0%B0%3A+'
         32        ROPE_ADD                                          1  ~23     ~23, !0
         33        ROPE_END                                          2  ~22     ~23, '%0A'
         34        ECHO                                                         ~22
   31    35        ASSIGN                                                       !5, <array>
   38    36      > FE_RESET_R                                           $26     !2, ->46
         37    > > FE_FETCH_R                                           ~27     $26, !3, ->46
         38    >   ASSIGN                                                       !4, ~27
   39    39      > JMP                                                          ->43
   40    40    >   FETCH_DIM_RW                                         $29     !5, !4
         41        PRE_INC                                                      $29
   41    42        ASSIGN_OP                                         2          !0, !4
   39    43    >   IS_SMALLER_OR_EQUAL                                          !4, !0
         44      > JMPNZ                                                        ~32, ->40
   38    45    > > JMP                                                          ->37
         46    >   FE_FREE                                                      $26
   45    47        ECHO                                                         '%D0%92%D1%8B%D0%B4%D0%B0%D1%87%D0%B0+%D0%B2%D0%BE%D0%B7%D0%BC%D0%BE%D0%B6%D0%BD%D0%B0%2C+%D1%87%D0%B8%D1%81%D0%BB%D0%BE+%D0%BA%D1%83%D0%BF%D1%8E%D1%80%3A%0A'
   46    48      > FE_RESET_R                                           $33     !5, ->57
         49    > > FE_FETCH_R                                           ~34     $33, !3, ->57
         50    >   ASSIGN                                                       !4, ~34
   47    51        ROPE_INIT                                         4  ~37     !3
         52        ROPE_ADD                                          1  ~37     ~37, 'x'
         53        ROPE_ADD                                          2  ~37     ~37, !4
         54        ROPE_END                                          3  ~36     ~37, '+'
         55        ECHO                                                         ~36
   46    56      > JMP                                                          ->49
         57    >   FE_FREE                                                      $33
   48    58      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.57 ms | 2309 KiB | 16 Q