3v4l.org

run code in 300+ PHP versions simultaneously
<?php $defolttext = ""; error_reporting(-1); if (!isset($_REQUEST['submit'])) { $text = ""; } else{ $text = $_REQUEST['text']; $clearbrpbi = array("<br>" => " ", "<br />" => " ", "<p>" => " ", "</p>" => "", "<i>" => "", "</i>" => "", "<b>" => "", "</b>" => "", "<" => "", ">" => "", '"' => ''); $cleartext = strtr($text, $clearbrpbi); $words = explode(" ", $cleartext); $curword = ""; $allwords = ""; $curwordsylamt = 0; $wor = 0; $wordsylamtall = 0; foreach ($words as $k => $v){ $curword = $v; $curwordsylamt = strlen($curword)/2.5;//количество слогов в текущем слове $wordssenarr[] = $curwordsylamt; $allwords .= $curword; $wordsylamtall += $curwordsylamt; $wor++;//счетчик слов } $nospaces = implode("", $words); $nospaceslen = strlen($nospaces);//общеее количество букв без пробелов $syllablesamt = $nospaceslen/2.5; $sentences = explode(".", $cleartext); $sentencesamt = count($sentences); $senwords = array(); $wordssenarr = array(); $sen = 0; $wordssenamt = 0; $wordssenamtall = 0; foreach ($sentences as $k => $v){ $senwords = explode(" ", $v); $wordssenamt = count($senwords);//количество слов в текущем предложении $wordssenarr[] = $wordssenamt; $wordssenamtall += $wordssenamt; $sen++;//счетчик предложений } $avg_sense_length_inwords = $wordssenamtall/$sen; $avg_words_length_insyllables = array_sum($wordssenarr)/$wor; $ASL = $avg_sense_length_inwords; $ASW = $avg_words_length_insyllables; $wordsamt = count($words); $textlen = strlen($cleartext); $FRE1 = 206.835 - 1.015*($wordsamt/$sentencesamt) - 84.6*($syllablesamt/$wordsamt); $FRE2 = 206.835 - (1.015*$ASL) - (84.6*$ASW); //$FleschKincaidGradeLevel= 0.39*(total words/total sentences)+11.8*(total syllables/total words)-15.59; $FleschKincaidGradeLevel= 0.39*($wordsamt/$sentencesamt)+11.8*($syllablesamt/$wordsamt)-15.59; $text = "Читаемость вашего текста равна FRE1 = $FRE1 ,FRE2 = $FRE2<br /><br /> Читаемость вашего текста по Flesch–Kincaid Grade Level равна FleschKincaidGradeLevel= 0.39(wordsamt/sentencesamt)+11.8(syllablesamt/wordsamt)-15.59 = 0.39($wordsamt\/$sentencesamt)\+11.8\($syllablesamt\/$wordsamt)\-15.59 = $FleschKincaidGradeLevel <br /><br /> <pre>".print_r($GLOBALS, true)."</pre>"; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru" lang="ru"> <body> <h2>Проверка читаемости текста по индексу Флеша</h2><br /> <?php echo $text; ?> <br /> <br /> <form action="" method=post> Ввведите текста у которого нужно проверить читаемость:<br /> <textarea name="text" rows="10" cols="45"> <?php echo $defolttext; ?></textarea><br /> <input type='submit' name='submit' value='Проверить' /> <hr> </form> </body> </html>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 10
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 135
Branch analysis from position: 135
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 77) Position 1 = 30, Position 2 = 42
Branch analysis from position: 30
2 jumps found. (Code = 78) Position 1 = 31, Position 2 = 42
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
Branch analysis from position: 42
2 jumps found. (Code = 77) Position 1 = 65, Position 2 = 79
Branch analysis from position: 65
2 jumps found. (Code = 78) Position 1 = 66, Position 2 = 79
Branch analysis from position: 66
1 jumps found. (Code = 42) Position 1 = 65
Branch analysis from position: 65
Branch analysis from position: 79
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 79
Branch analysis from position: 42
filename:       /in/MMOm3
function name:  (null)
number of ops:  141
compiled vars:  !0 = $defolttext, !1 = $text, !2 = $clearbrpbi, !3 = $cleartext, !4 = $words, !5 = $curword, !6 = $allwords, !7 = $curwordsylamt, !8 = $wor, !9 = $wordsylamtall, !10 = $v, !11 = $k, !12 = $wordssenarr, !13 = $nospaces, !14 = $nospaceslen, !15 = $syllablesamt, !16 = $sentences, !17 = $sentencesamt, !18 = $senwords, !19 = $sen, !20 = $wordssenamt, !21 = $wordssenamtall, !22 = $avg_sense_length_inwords, !23 = $avg_words_length_insyllables, !24 = $ASL, !25 = $ASW, !26 = $wordsamt, !27 = $textlen, !28 = $FRE1, !29 = $FRE2, !30 = $FleschKincaidGradeLevel
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, ''
    3     1        INIT_FCALL                                               'error_reporting'
          2        SEND_VAL                                                 -1
          3        DO_ICALL                                                 
    5     4        FETCH_IS                                         ~33     '_REQUEST'
          5        ISSET_ISEMPTY_DIM_OBJ                         0  ~34     ~33, 'submit'
          6        BOOL_NOT                                         ~35     ~34
          7      > JMPZ                                                     ~35, ->10
    6     8    >   ASSIGN                                                   !1, ''
          9      > JMP                                                      ->135
    9    10    >   FETCH_R                      global              ~37     '_REQUEST'
         11        FETCH_DIM_R                                      ~38     ~37, 'text'
         12        ASSIGN                                                   !1, ~38
   10    13        ASSIGN                                                   !2, <array>
   12    14        INIT_FCALL                                               'strtr'
         15        SEND_VAR                                                 !1
         16        SEND_VAR                                                 !2
         17        DO_ICALL                                         $41     
         18        ASSIGN                                                   !3, $41
   13    19        INIT_FCALL                                               'explode'
         20        SEND_VAL                                                 '+'
         21        SEND_VAR                                                 !3
         22        DO_ICALL                                         $43     
         23        ASSIGN                                                   !4, $43
   14    24        ASSIGN                                                   !5, ''
   15    25        ASSIGN                                                   !6, ''
   16    26        ASSIGN                                                   !7, 0
   17    27        ASSIGN                                                   !8, 0
   18    28        ASSIGN                                                   !9, 0
   19    29      > FE_RESET_R                                       $50     !4, ->42
         30    > > FE_FETCH_R                                       ~51     $50, !10, ->42
         31    >   ASSIGN                                                   !11, ~51
   20    32        ASSIGN                                                   !5, !10
   21    33        STRLEN                                           ~54     !5
         34        DIV                                              ~55     ~54, 2.5
         35        ASSIGN                                                   !7, ~55
   22    36        ASSIGN_DIM                                               !12
         37        OP_DATA                                                  !7
   23    38        ASSIGN_OP                                     8          !6, !5
   24    39        ASSIGN_OP                                     1          !9, !7
   25    40        PRE_INC                                                  !8
   19    41      > JMP                                                      ->30
         42    >   FE_FREE                                                  $50
   27    43        INIT_FCALL                                               'implode'
         44        SEND_VAL                                                 ''
         45        SEND_VAR                                                 !4
         46        DO_ICALL                                         $61     
         47        ASSIGN                                                   !13, $61
   28    48        STRLEN                                           ~63     !13
         49        ASSIGN                                                   !14, ~63
   29    50        DIV                                              ~65     !14, 2.5
         51        ASSIGN                                                   !15, ~65
   30    52        INIT_FCALL                                               'explode'
         53        SEND_VAL                                                 '.'
         54        SEND_VAR                                                 !3
         55        DO_ICALL                                         $67     
         56        ASSIGN                                                   !16, $67
   31    57        COUNT                                            ~69     !16
         58        ASSIGN                                                   !17, ~69
   32    59        ASSIGN                                                   !18, <array>
   33    60        ASSIGN                                                   !12, <array>
   34    61        ASSIGN                                                   !19, 0
   35    62        ASSIGN                                                   !20, 0
   36    63        ASSIGN                                                   !21, 0
   37    64      > FE_RESET_R                                       $76     !16, ->79
         65    > > FE_FETCH_R                                       ~77     $76, !10, ->79
         66    >   ASSIGN                                                   !11, ~77
   38    67        INIT_FCALL                                               'explode'
         68        SEND_VAL                                                 '+'
         69        SEND_VAR                                                 !10
         70        DO_ICALL                                         $79     
         71        ASSIGN                                                   !18, $79
   39    72        COUNT                                            ~81     !18
         73        ASSIGN                                                   !20, ~81
   40    74        ASSIGN_DIM                                               !12
         75        OP_DATA                                                  !20
   41    76        ASSIGN_OP                                     1          !21, !20
   42    77        PRE_INC                                                  !19
   37    78      > JMP                                                      ->65
         79    >   FE_FREE                                                  $76
   44    80        DIV                                              ~86     !21, !19
         81        ASSIGN                                                   !22, ~86
   45    82        INIT_FCALL                                               'array_sum'
         83        SEND_VAR                                                 !12
         84        DO_ICALL                                         $88     
         85        DIV                                              ~89     $88, !8
         86        ASSIGN                                                   !23, ~89
   46    87        ASSIGN                                                   !24, !22
   47    88        ASSIGN                                                   !25, !23
   48    89        COUNT                                            ~93     !4
         90        ASSIGN                                                   !26, ~93
   49    91        STRLEN                                           ~95     !3
         92        ASSIGN                                                   !27, ~95
   51    93        DIV                                              ~97     !26, !17
         94        MUL                                              ~98     ~97, 1.015
         95        SUB                                              ~99     206.835, ~98
         96        DIV                                              ~100    !15, !26
         97        MUL                                              ~101    ~100, 84.6
         98        SUB                                              ~102    ~99, ~101
         99        ASSIGN                                                   !28, ~102
   53   100        MUL                                              ~104    !24, 1.015
        101        SUB                                              ~105    206.835, ~104
        102        MUL                                              ~106    !25, 84.6
        103        SUB                                              ~107    ~105, ~106
        104        ASSIGN                                                   !29, ~107
   55   105        DIV                                              ~109    !26, !17
        106        MUL                                              ~110    ~109, 0.39
        107        DIV                                              ~111    !15, !26
        108        MUL                                              ~112    ~111, 11.8
        109        ADD                                              ~113    ~110, ~112
        110        SUB                                              ~114    ~113, 15.59
        111        ASSIGN                                                   !30, ~114
   57   112        ROPE_INIT                                    15  ~117    '%D0%A7%D0%B8%D1%82%D0%B0%D0%B5%D0%BC%D0%BE%D1%81%D1%82%D1%8C+%D0%B2%D0%B0%D1%88%D0%B5%D0%B3%D0%BE+%D1%82%D0%B5%D0%BA%D1%81%D1%82%D0%B0+%D1%80%D0%B0%D0%B2%D0%BD%D0%B0+FRE1+%3D+'
        113        ROPE_ADD                                      1  ~117    ~117, !28
        114        ROPE_ADD                                      2  ~117    ~117, '+%2CFRE2+%3D+'
        115        ROPE_ADD                                      3  ~117    ~117, !29
        116        ROPE_ADD                                      4  ~117    ~117, '%3Cbr+%2F%3E%3Cbr+%2F%3E%0A%09%D0%A7%D0%B8%D1%82%D0%B0%D0%B5%D0%BC%D0%BE%D1%81%D1%82%D1%8C+%D0%B2%D0%B0%D1%88%D0%B5%D0%B3%D0%BE+%D1%82%D0%B5%D0%BA%D1%81%D1%82%D0%B0+%D0%BF%D0%BE+Flesch%E2%80%93Kincaid+Grade+Level+%D1%80%D0%B0%D0%B2%D0%BD%D0%B0+%0A%09FleschKincaidGradeLevel%3D+0.39%28wordsamt%2Fsentencesamt%29%2B11.8%28syllablesamt%2Fwordsamt%29-15.59+%3D+0.39%28'
   59   117        ROPE_ADD                                      5  ~117    ~117, !26
        118        ROPE_ADD                                      6  ~117    ~117, '%5C%2F'
        119        ROPE_ADD                                      7  ~117    ~117, !17
        120        ROPE_ADD                                      8  ~117    ~117, '%29%5C%2B11.8%5C%28'
        121        ROPE_ADD                                      9  ~117    ~117, !15
        122        ROPE_ADD                                     10  ~117    ~117, '%5C%2F'
        123        ROPE_ADD                                     11  ~117    ~117, !26
        124        ROPE_ADD                                     12  ~117    ~117, '%29%5C-15.59+%3D+'
        125        ROPE_ADD                                     13  ~117    ~117, !30
        126        ROPE_END                                     14  ~116    ~117, '%0A%09%3Cbr+%2F%3E%3Cbr+%2F%3E%0A%09%0A%09%3Cpre%3E'
   62   127        INIT_FCALL                                               'print_r'
        128        FETCH_R                      global              ~125    'GLOBALS'
        129        SEND_VAL                                                 ~125
        130        SEND_VAL                                                 <true>
        131        DO_ICALL                                         $126    
        132        CONCAT                                           ~127    ~116, $126
        133        CONCAT                                           ~128    ~127, '%3C%2Fpre%3E'
   57   134        ASSIGN                                                   !1, ~128
   66   135    >   ECHO                                                     '%0A%3C%21DOCTYPE+html+PUBLIC+%22-%2F%2FW3C%2F%2FDTD+XHTML+1.0+Strict%2F%2FEN%22+%22http%3A%2F%2Fwww.w3.org%2FTR%2Fxhtml1%2FDTD%2Fxhtml1-strict.dtd%22%3E%0A%0A%3Chtml++xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22+xml%3Alang%3D%22ru%22+lang%3D%22ru%22%3E%0A%0A%0A%3Cbody%3E%0A%3Ch2%3E%D0%9F%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%BA%D0%B0+%D1%87%D0%B8%D1%82%D0%B0%D0%B5%D0%BC%D0%BE%D1%81%D1%82%D0%B8+%D1%82%D0%B5%D0%BA%D1%81%D1%82%D0%B0+%D0%BF%D0%BE+%D0%B8%D0%BD%D0%B4%D0%B5%D0%BA%D1%81%D1%83+%D0%A4%D0%BB%D0%B5%D1%88%D0%B0%3C%2Fh2%3E%3Cbr+%2F%3E%0A'
   74   136        ECHO                                                     !1
   75   137        ECHO                                                     '%3Cbr+%2F%3E%0A%3Cbr+%2F%3E%0A%3Cform+action%3D%22%22+method%3Dpost%3E%0A%D0%92%D0%B2%D0%B2%D0%B5%D0%B4%D0%B8%D1%82%D0%B5+%D1%82%D0%B5%D0%BA%D1%81%D1%82%D0%B0+%D1%83+%D0%BA%D0%BE%D1%82%D0%BE%D1%80%D0%BE%D0%B3%D0%BE+%D0%BD%D1%83%D0%B6%D0%BD%D0%BE+%D0%BF%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%B8%D1%82%D1%8C+%D1%87%D0%B8%D1%82%D0%B0%D0%B5%D0%BC%D0%BE%D1%81%D1%82%D1%8C%3A%3Cbr+%2F%3E%0A%09%09%09%3Ctextarea+name%3D%22text%22+rows%3D%2210%22+cols%3D%2245%22%3E+'
   79   138        ECHO                                                     !0
        139        ECHO                                                     '%3C%2Ftextarea%3E%3Cbr+%2F%3E%0A%09%09%09%3Cinput+type%3D%27submit%27+name%3D%27submit%27+value%3D%27%D0%9F%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%B8%D1%82%D1%8C%27+%2F%3E%0A%3Chr%3E%0A%3C%2Fform%3E%0A%3C%2Fbody%3E%0A%3C%2Fhtml%3E'
   84   140      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.98 ms | 1413 KiB | 25 Q