3v4l.org

run code in 300+ PHP versions simultaneously
<?php function aa($sayi) { $birim=explode('.', $sayi); $tam = $birim[0]; // sayının virgülden önceki kısmı-tam if(empty($birim[1])) { $birim[1]=0; } $onda = $birim[1]; // sayının virgülden sonraki kısmı-ondalık $birler = array("","bir ","iki","üç","dört","beş","altı","yedi","sekiz","dokuz"); $onlar = array("","on","yirmi","otuz","kırk","elli","altmış","yetmiş","seksen","doksan"); $yuzler = array("","yüz","ikiyüz","üçyüz","dörtyüz","beşyüz","altıyüz","yediyüz","sekizyüz","dokuzyüz"); $deger = array("","","bin","milyon","milyar","trilyon","katrilyon","kentilyon ","seksilyon ","septilyon ","oktilyon "); if(strlen($onda)<2) { $onda = $onda*10; // 56,2 değerini 56,20 yapan kısım. Böylece 56,2 -56 lira 2 kuruş- olmuyor. } $bir=substr($onda,1,1); // birler basamağını alıyor $on=substr($onda,0,1); // onlar basamağını alıyor $ondalik_yazi=$onlar[$on].$birler[$bir]; // ondalık kısmı yazı haline çevirdik artık tam kısım üzerinde çalışacağız. $format_tam_sayi = number_format($tam); // sayı formatlanıyor -> 2658 to 2,658 $tam_sayi = explode(',', $format_tam_sayi); // formatlanan sayı parçalanıp diziye aktarılıyor $count_tam_sayi = count($tam_sayi); // burda dizinin eleman sayısını buluyoruz. // eğer sayımız 4,5,6 haneli ise 687,655 olacağı için dizi 2 elemanlı for($i=0;$i<$count_tam_sayi;$i++) { $eksik =(3-strlen($tam_sayi[$i])); // sayının kaç haneli olduğu ve 3 haneli olması için gereken sayı for($j=0;$j<$eksik;$j++) { $tam_sayi[$i] = "0".$tam_sayi[$i]; // eğer sayı 3 haneli değilse başına 0 ekliyor. } $birl=substr($tam_sayi[$i],2,1); // birler basamağını alıyor $ikil=substr($tam_sayi[$i],1,1); // onlar basamağını alıyor $ucl=substr($tam_sayi[$i],0,1); // yüzler basamağını alıyor $yazi[$i] = $yuzler[$ucl].$onlar[$ikil].$birler[$birl].$deger[$count_tam_sayi-$i]; // sayıyı yazıya çeviren kısım // sayının her 3 hanesi yazıya çevriliyor. 550 bin, milyon, milyar gibi. } $yazi_hali =""; for($i=0;$i<$count_tam_sayi;$i++) { $yazi_hali .= $yazi[$i]; } echo $yazi_hali."-TL ".$ondalik_yazi."-KR"; } echo ss('10001000005');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3HYPZ
function name:  (null)
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   58     0  E >   INIT_FCALL_BY_NAME                                       'ss'
          1        SEND_VAL_EX                                              '10001000005'
          2        DO_FCALL                                      0  $0      
          3        ECHO                                                     $0
          4      > RETURN                                                   1

Function aa:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 23
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 97
Branch analysis from position: 97
2 jumps found. (Code = 44) Position 1 = 99, Position 2 = 52
Branch analysis from position: 99
1 jumps found. (Code = 42) Position 1 = 105
Branch analysis from position: 105
2 jumps found. (Code = 44) Position 1 = 107, Position 2 = 102
Branch analysis from position: 107
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 102
2 jumps found. (Code = 44) Position 1 = 107, Position 2 = 102
Branch analysis from position: 107
Branch analysis from position: 102
Branch analysis from position: 52
1 jumps found. (Code = 42) Position 1 = 63
Branch analysis from position: 63
2 jumps found. (Code = 44) Position 1 = 65, Position 2 = 58
Branch analysis from position: 65
2 jumps found. (Code = 44) Position 1 = 99, Position 2 = 52
Branch analysis from position: 99
Branch analysis from position: 52
Branch analysis from position: 58
2 jumps found. (Code = 44) Position 1 = 65, Position 2 = 58
Branch analysis from position: 65
Branch analysis from position: 58
Branch analysis from position: 23
Branch analysis from position: 12
filename:       /in/3HYPZ
function name:  aa
number of ops:  112
compiled vars:  !0 = $sayi, !1 = $birim, !2 = $tam, !3 = $onda, !4 = $birler, !5 = $onlar, !6 = $yuzler, !7 = $deger, !8 = $bir, !9 = $on, !10 = $ondalik_yazi, !11 = $format_tam_sayi, !12 = $tam_sayi, !13 = $count_tam_sayi, !14 = $i, !15 = $eksik, !16 = $j, !17 = $birl, !18 = $ikil, !19 = $ucl, !20 = $yazi, !21 = $yazi_hali
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
    5     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '.'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $22     
          5        ASSIGN                                                   !1, $22
    6     6        FETCH_DIM_R                                      ~24     !1, 0
          7        ASSIGN                                                   !2, ~24
    7     8        ISSET_ISEMPTY_DIM_OBJ                         1          !1, 1
          9      > JMPZ                                                     ~26, ->12
         10    >   ASSIGN_DIM                                               !1, 1
         11        OP_DATA                                                  0
    8    12    >   FETCH_DIM_R                                      ~28     !1, 1
         13        ASSIGN                                                   !3, ~28
   10    14        ASSIGN                                                   !4, <array>
   11    15        ASSIGN                                                   !5, <array>
   12    16        ASSIGN                                                   !6, <array>
   13    17        ASSIGN                                                   !7, <array>
   15    18        STRLEN                                           ~34     !3
         19        IS_SMALLER                                               ~34, 2
         20      > JMPZ                                                     ~35, ->23
   17    21    >   MUL                                              ~36     !3, 10
         22        ASSIGN                                                   !3, ~36
   20    23    >   INIT_FCALL                                               'substr'
         24        SEND_VAR                                                 !3
         25        SEND_VAL                                                 1
         26        SEND_VAL                                                 1
         27        DO_ICALL                                         $38     
         28        ASSIGN                                                   !8, $38
   21    29        INIT_FCALL                                               'substr'
         30        SEND_VAR                                                 !3
         31        SEND_VAL                                                 0
         32        SEND_VAL                                                 1
         33        DO_ICALL                                         $40     
         34        ASSIGN                                                   !9, $40
   23    35        FETCH_DIM_R                                      ~42     !5, !9
         36        FETCH_DIM_R                                      ~43     !4, !8
         37        CONCAT                                           ~44     ~42, ~43
         38        ASSIGN                                                   !10, ~44
   25    39        INIT_FCALL                                               'number_format'
         40        SEND_VAR                                                 !2
         41        DO_ICALL                                         $46     
         42        ASSIGN                                                   !11, $46
   27    43        INIT_FCALL                                               'explode'
         44        SEND_VAL                                                 '%2C'
         45        SEND_VAR                                                 !11
         46        DO_ICALL                                         $48     
         47        ASSIGN                                                   !12, $48
   29    48        COUNT                                            ~50     !12
         49        ASSIGN                                                   !13, ~50
   31    50        ASSIGN                                                   !14, 0
         51      > JMP                                                      ->97
   33    52    >   FETCH_DIM_R                                      ~53     !12, !14
         53        STRLEN                                           ~54     ~53
         54        SUB                                              ~55     3, ~54
         55        ASSIGN                                                   !15, ~55
   35    56        ASSIGN                                                   !16, 0
         57      > JMP                                                      ->63
   37    58    >   FETCH_DIM_R                                      ~59     !12, !14
         59        CONCAT                                           ~60     '0', ~59
         60        ASSIGN_DIM                                               !12, !14
         61        OP_DATA                                                  ~60
   35    62        PRE_INC                                                  !16
         63    >   IS_SMALLER                                               !16, !15
         64      > JMPNZ                                                    ~62, ->58
   40    65    >   INIT_FCALL                                               'substr'
         66        FETCH_DIM_R                                      ~63     !12, !14
         67        SEND_VAL                                                 ~63
         68        SEND_VAL                                                 2
         69        SEND_VAL                                                 1
         70        DO_ICALL                                         $64     
         71        ASSIGN                                                   !17, $64
   41    72        INIT_FCALL                                               'substr'
         73        FETCH_DIM_R                                      ~66     !12, !14
         74        SEND_VAL                                                 ~66
         75        SEND_VAL                                                 1
         76        SEND_VAL                                                 1
         77        DO_ICALL                                         $67     
         78        ASSIGN                                                   !18, $67
   42    79        INIT_FCALL                                               'substr'
         80        FETCH_DIM_R                                      ~69     !12, !14
         81        SEND_VAL                                                 ~69
         82        SEND_VAL                                                 0
         83        SEND_VAL                                                 1
         84        DO_ICALL                                         $70     
         85        ASSIGN                                                   !19, $70
   44    86        FETCH_DIM_R                                      ~73     !6, !19
         87        FETCH_DIM_R                                      ~74     !5, !18
         88        CONCAT                                           ~75     ~73, ~74
         89        FETCH_DIM_R                                      ~76     !4, !17
         90        CONCAT                                           ~77     ~75, ~76
         91        SUB                                              ~78     !13, !14
         92        FETCH_DIM_R                                      ~79     !7, ~78
         93        CONCAT                                           ~80     ~77, ~79
         94        ASSIGN_DIM                                               !20, !14
         95        OP_DATA                                                  ~80
   31    96        PRE_INC                                                  !14
         97    >   IS_SMALLER                                               !14, !13
         98      > JMPNZ                                                    ~82, ->52
   49    99    >   ASSIGN                                                   !21, ''
   50   100        ASSIGN                                                   !14, 0
        101      > JMP                                                      ->105
   52   102    >   FETCH_DIM_R                                      ~85     !20, !14
        103        ASSIGN_OP                                     8          !21, ~85
   50   104        PRE_INC                                                  !14
        105    >   IS_SMALLER                                               !14, !13
        106      > JMPNZ                                                    ~88, ->102
   55   107    >   CONCAT                                           ~89     !21, '-TL+'
        108        CONCAT                                           ~90     ~89, !10
        109        CONCAT                                           ~91     ~90, '-KR'
        110        ECHO                                                     ~91
   56   111      > RETURN                                                   null

End of function aa

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.73 ms | 1404 KiB | 19 Q