3v4l.org

run code in 500+ PHP versions simultaneously
<?php header("Content-Type: text/plain; charset=utf-8"); mb_internal_encoding('utf-8'); //ПолучитьСуммуКредита(СуммаКредита, ежемесячная плата, процент, ежемесечнаяКомиссия, единовременнаяВыплата, названиеБанка) function getSumCredit($value, $pay, $persent, $comiss, $onceComiss, $bankName) { If ($onceComiss > 0) { $value+=$onceComiss; //Прибавляем к долгу единовременную выплату. } $a = true; $mes = 0; $sum= 0; while ($a==true): $value = $value + ($comiss+$value*$persent/100); $mes+=1; If ($value>$pay) { $value -=$pay; $sum +=$pay; } else { $sum+=$value; $sum=round($sum); $a=false; echo "Кредит от банка {$bankName}, обойдётся в {$sum}, выплаты составят - {$mes} месяцев\n"; } endwhile; } //ПолучитьСуммуКредита(СуммаКредита, ежемесячная плата, процент, ежемесечнаяКомиссия, единовременнаяВыплата, названиеБанка) getSumCredit(39999, 5000, 4, 500, 0, "HomoCredit"); getSumCredit(40000, 5000, 3, 1000, 0,"Softbank"); getSumCredit(39999, 5000, 2, 0, 7777, "StrawberryBank"); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/0Ph5L
function name:  (null)
number of ops:  31
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                                   'header'
          1        SEND_VAL                                                     'Content-Type%3A+text%2Fplain%3B+charset%3Dutf-8'
          2        DO_ICALL                                                     
    3     3        INIT_FCALL                                                   'mb_internal_encoding'
          4        SEND_VAL                                                     'utf-8'
          5        DO_ICALL                                                     
   39     6        INIT_FCALL                                                   'getsumcredit'
          7        SEND_VAL                                                     39999
          8        SEND_VAL                                                     5000
          9        SEND_VAL                                                     4
         10        SEND_VAL                                                     500
         11        SEND_VAL                                                     0
         12        SEND_VAL                                                     'HomoCredit'
         13        DO_FCALL                                          0          
   40    14        INIT_FCALL                                                   'getsumcredit'
         15        SEND_VAL                                                     40000
         16        SEND_VAL                                                     5000
         17        SEND_VAL                                                     3
         18        SEND_VAL                                                     1000
         19        SEND_VAL                                                     0
         20        SEND_VAL                                                     'Softbank'
         21        DO_FCALL                                          0          
   41    22        INIT_FCALL                                                   'getsumcredit'
         23        SEND_VAL                                                     39999
         24        SEND_VAL                                                     5000
         25        SEND_VAL                                                     2
         26        SEND_VAL                                                     0
         27        SEND_VAL                                                     7777
         28        SEND_VAL                                                     'StrawberryBank'
         29        DO_FCALL                                          0          
   42    30      > RETURN                                                       1

Function getsumcredit:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 9
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 13
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 24
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 38
Branch analysis from position: 38
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 40, Position 2 = 13
Branch analysis from position: 40
Branch analysis from position: 13
Branch analysis from position: 9
filename:       /in/0Ph5L
function name:  getSumCredit
number of ops:  41
compiled vars:  !0 = $value, !1 = $pay, !2 = $persent, !3 = $comiss, !4 = $onceComiss, !5 = $bankName, !6 = $a, !7 = $mes, !8 = $sum
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        RECV                                                 !2      
          3        RECV                                                 !3      
          4        RECV                                                 !4      
          5        RECV                                                 !5      
    9     6        IS_SMALLER                                                   0, !4
          7      > JMPZ                                                         ~9, ->9
   11     8    >   ASSIGN_OP                                         1          !0, !4
   13     9    >   ASSIGN                                                       !6, <true>
   14    10        ASSIGN                                                       !7, 0
   15    11        ASSIGN                                                       !8, 0
   16    12      > JMP                                                          ->38
   19    13    >   MUL                                                  ~14     !0, !2
         14        DIV                                                  ~15     ~14, 100
         15        ADD                                                  ~16     !3, ~15
         16        ADD                                                  ~17     !0, ~16
         17        ASSIGN                                                       !0, ~17
   20    18        ASSIGN_OP                                         1          !7, 1
   21    19        IS_SMALLER                                                   !1, !0
         20      > JMPZ                                                         ~20, ->24
   24    21    >   ASSIGN_OP                                         2          !0, !1
   25    22        ASSIGN_OP                                         1          !8, !1
   21    23      > JMP                                                          ->38
   29    24    >   ASSIGN_OP                                         1          !8, !0
   30    25        INIT_FCALL                                                   'round'
         26        SEND_VAR                                                     !8
         27        DO_ICALL                                             $24     
         28        ASSIGN                                                       !8, $24
   31    29        ASSIGN                                                       !6, <false>
   32    30        ROPE_INIT                                         7  ~28     '%D0%9A%D1%80%D0%B5%D0%B4%D0%B8%D1%82+%D0%BE%D1%82+%D0%B1%D0%B0%D0%BD%D0%BA%D0%B0+'
         31        ROPE_ADD                                          1  ~28     ~28, !5
         32        ROPE_ADD                                          2  ~28     ~28, '%2C+%D0%BE%D0%B1%D0%BE%D0%B9%D0%B4%D1%91%D1%82%D1%81%D1%8F+%D0%B2+'
         33        ROPE_ADD                                          3  ~28     ~28, !8
         34        ROPE_ADD                                          4  ~28     ~28, '%2C+%D0%B2%D1%8B%D0%BF%D0%BB%D0%B0%D1%82%D1%8B+%D1%81%D0%BE%D1%81%D1%82%D0%B0%D0%B2%D1%8F%D1%82+-+'
         35        ROPE_ADD                                          5  ~28     ~28, !7
         36        ROPE_END                                          6  ~27     ~28, '+%D0%BC%D0%B5%D1%81%D1%8F%D1%86%D0%B5%D0%B2%0A'
         37        ECHO                                                         ~27
   16    38    >   IS_EQUAL                                                     !6, <true>
         39      > JMPNZ                                                        ~32, ->13
   36    40    > > RETURN                                                       null

End of function getsumcredit

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
205.58 ms | 2689 KiB | 19 Q