3v4l.org

run code in 300+ PHP versions simultaneously
<?php $message = "输入法. 手写; 拼音; 关闭. 百科 文库 hao123 | 更多>> · 把百度设为主页把百度设为主页关于百度About Baidu. ©2014 Baidu 使用百度前必读 京ICP证030173号.";$end_html = 0;$start_html = 1;$tmp_message = '';$message = ' ' . $message . ' ';$html_entities_match = array('#&(?!(\#[0-9]+;))#', '#<#', '#>#');$html_entities_replace = array('&amp;', '&lt;', '&gt;');$html_on = 1; $bbcode_on = 1;$bbcode_uid = 1;$message = trim($message); if ($html_on) { $allowed_html_tags = split(',', '<b>,</b>'); $end_html = 0; $start_html = 1; $tmp_message = ''; $message = ' ' . $message . ' '; while ($start_html = strpos($message, '<', $start_html)) { $tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($message, $end_html + 1, ($start_html - $end_html - 1))); if ($end_html = strpos($message, '>', $start_html)) { $length = $end_html - $start_html + 1; $hold_string = substr($message, $start_html, $length); if (($unclosed_open = strrpos(' ' . $hold_string, '<')) != 1) { $tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($hold_string, 0, $unclosed_open - 1)); $hold_string = substr($hold_string, $unclosed_open - 1); } $tagallowed = false; for ($i = 0; $i < sizeof($allowed_html_tags); $i++) { $match_tag = trim($allowed_html_tags[$i]); if (preg_match('#^<\/?' . $match_tag . '[> ]#i', $hold_string)) { $tagallowed = (preg_match('#^<\/?' . $match_tag . ' .*?(style[ ]*?=|on[\w]+[ ]*?=)#i', $hold_string)) ? false : true; } } $tmp_message .= ($length && !$tagallowed) ? preg_replace($html_entities_match, $html_entities_replace, $hold_string) : $hold_string; $start_html += $length; } else { $tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($message, $start_html, strlen($message))); $start_html = strlen($message); $end_html = $start_html; } } if ($end_html != strlen($message) && $tmp_message != '') { $tmp_message .= preg_replace($html_entities_match, $html_entities_replace, substr($message, $end_html + 1)); } $message = ($tmp_message != '') ? trim($tmp_message) : trim($message); } else { $message = preg_replace($html_entities_match, $html_entities_replace, $message); } // Decode the html entities for HTMLArea / TMEdit $message = str_replace('&amp;', '&', $message); $message = html_entity_decode($message); if($bbcode_on && $bbcode_uid != '') { $message = bbencode_first_pass($message, $bbcode_uid); } echo $message;
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 182
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 145
Branch analysis from position: 145
2 jumps found. (Code = 44) Position 1 = 152, Position 2 = 29
Branch analysis from position: 152
2 jumps found. (Code = 46) Position 1 = 155, Position 2 = 157
Branch analysis from position: 155
2 jumps found. (Code = 43) Position 1 = 158, Position 2 = 169
Branch analysis from position: 158
2 jumps found. (Code = 43) Position 1 = 171, Position 2 = 176
Branch analysis from position: 171
1 jumps found. (Code = 42) Position 1 = 180
Branch analysis from position: 180
1 jumps found. (Code = 42) Position 1 = 188
Branch analysis from position: 188
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 176
1 jumps found. (Code = 42) Position 1 = 188
Branch analysis from position: 188
Branch analysis from position: 169
Branch analysis from position: 157
Branch analysis from position: 29
2 jumps found. (Code = 43) Position 1 = 50, Position 2 = 130
Branch analysis from position: 50
2 jumps found. (Code = 43) Position 1 = 67, Position 2 = 85
Branch analysis from position: 67
1 jumps found. (Code = 42) Position 1 = 112
Branch analysis from position: 112
2 jumps found. (Code = 44) Position 1 = 115, Position 2 = 88
Branch analysis from position: 115
2 jumps found. (Code = 46) Position 1 = 116, Position 2 = 118
Branch analysis from position: 116
2 jumps found. (Code = 43) Position 1 = 119, Position 2 = 126
Branch analysis from position: 119
1 jumps found. (Code = 42) Position 1 = 127
Branch analysis from position: 127
1 jumps found. (Code = 42) Position 1 = 145
Branch analysis from position: 145
Branch analysis from position: 126
1 jumps found. (Code = 42) Position 1 = 145
Branch analysis from position: 145
Branch analysis from position: 118
Branch analysis from position: 88
2 jumps found. (Code = 43) Position 1 = 100, Position 2 = 111
Branch analysis from position: 100
2 jumps found. (Code = 43) Position 1 = 107, Position 2 = 109
Branch analysis from position: 107
1 jumps found. (Code = 42) Position 1 = 110
Branch analysis from position: 110
2 jumps found. (Code = 44) Position 1 = 115, Position 2 = 88
Branch analysis from position: 115
Branch analysis from position: 88
Branch analysis from position: 109
2 jumps found. (Code = 44) Position 1 = 115, Position 2 = 88
Branch analysis from position: 115
Branch analysis from position: 88
Branch analysis from position: 111
Branch analysis from position: 85
Branch analysis from position: 130
2 jumps found. (Code = 44) Position 1 = 152, Position 2 = 29
Branch analysis from position: 152
Branch analysis from position: 29
Branch analysis from position: 182
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/uLmMv
function name:  (null)
number of ops:  189
compiled vars:  !0 = $message, !1 = $end_html, !2 = $start_html, !3 = $tmp_message, !4 = $html_entities_match, !5 = $html_entities_replace, !6 = $html_on, !7 = $bbcode_on, !8 = $bbcode_uid, !9 = $allowed_html_tags, !10 = $length, !11 = $hold_string, !12 = $unclosed_open, !13 = $tagallowed, !14 = $i, !15 = $match_tag
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%E8%BE%93%E5%85%A5%E6%B3%95.+%E6%89%8B%E5%86%99%3B+%E6%8B%BC%E9%9F%B3%3B+%E5%85%B3%E9%97%AD.+%E7%99%BE%E7%A7%91+%E6%96%87%E5%BA%93+hao123+%7C+%E6%9B%B4%E5%A4%9A%3E%3E+%C2%B7+%E6%8A%8A%E7%99%BE%E5%BA%A6%E8%AE%BE%E4%B8%BA%E4%B8%BB%E9%A1%B5%E6%8A%8A%E7%99%BE%E5%BA%A6%E8%AE%BE%E4%B8%BA%E4%B8%BB%E9%A1%B5%E5%85%B3%E4%BA%8E%E7%99%BE%E5%BA%A6About+Baidu.+%C2%A92014+Baidu+%E4%BD%BF%E7%94%A8%E7%99%BE%E5%BA%A6%E5%89%8D%E5%BF%85%E8%AF%BB+%E4%BA%ACICP%E8%AF%81030173%E5%8F%B7.'
          1        ASSIGN                                                   !1, 0
          2        ASSIGN                                                   !2, 1
          3        ASSIGN                                                   !3, ''
          4        CONCAT                                           ~20     '+', !0
          5        CONCAT                                           ~21     ~20, '+'
          6        ASSIGN                                                   !0, ~21
          7        ASSIGN                                                   !4, <array>
          8        ASSIGN                                                   !5, <array>
          9        ASSIGN                                                   !6, 1
         10        ASSIGN                                                   !7, 1
         11        ASSIGN                                                   !8, 1
         12        INIT_FCALL                                               'trim'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $28     
         15        ASSIGN                                                   !0, $28
         16      > JMPZ                                                     !6, ->182
         17    >   INIT_FCALL_BY_NAME                                       'split'
         18        SEND_VAL_EX                                              '%2C'
         19        SEND_VAL_EX                                              '%3Cb%3E%2C%3C%2Fb%3E'
         20        DO_FCALL                                      0  $30     
         21        ASSIGN                                                   !9, $30
         22        ASSIGN                                                   !1, 0
         23        ASSIGN                                                   !2, 1
         24        ASSIGN                                                   !3, ''
         25        CONCAT                                           ~35     '+', !0
         26        CONCAT                                           ~36     ~35, '+'
         27        ASSIGN                                                   !0, ~36
         28      > JMP                                                      ->145
         29    >   INIT_FCALL                                               'preg_replace'
         30        SEND_VAR                                                 !4
         31        SEND_VAR                                                 !5
         32        INIT_FCALL                                               'substr'
         33        SEND_VAR                                                 !0
         34        ADD                                              ~38     !1, 1
         35        SEND_VAL                                                 ~38
         36        SUB                                              ~39     !2, !1
         37        SUB                                              ~40     ~39, 1
         38        SEND_VAL                                                 ~40
         39        DO_ICALL                                         $41     
         40        SEND_VAR                                                 $41
         41        DO_ICALL                                         $42     
         42        ASSIGN_OP                                     8          !3, $42
         43        INIT_FCALL                                               'strpos'
         44        SEND_VAR                                                 !0
         45        SEND_VAL                                                 '%3E'
         46        SEND_VAR                                                 !2
         47        DO_ICALL                                         $44     
         48        ASSIGN                                           ~45     !1, $44
         49      > JMPZ                                                     ~45, ->130
         50    >   SUB                                              ~46     !1, !2
         51        ADD                                              ~47     ~46, 1
         52        ASSIGN                                                   !10, ~47
         53        INIT_FCALL                                               'substr'
         54        SEND_VAR                                                 !0
         55        SEND_VAR                                                 !2
         56        SEND_VAR                                                 !10
         57        DO_ICALL                                         $49     
         58        ASSIGN                                                   !11, $49
         59        INIT_FCALL                                               'strrpos'
         60        CONCAT                                           ~51     '+', !11
         61        SEND_VAL                                                 ~51
         62        SEND_VAL                                                 '%3C'
         63        DO_ICALL                                         $52     
         64        ASSIGN                                           ~53     !12, $52
         65        IS_NOT_EQUAL                                             ~53, 1
         66      > JMPZ                                                     ~54, ->85
         67    >   INIT_FCALL                                               'preg_replace'
         68        SEND_VAR                                                 !4
         69        SEND_VAR                                                 !5
         70        INIT_FCALL                                               'substr'
         71        SEND_VAR                                                 !11
         72        SEND_VAL                                                 0
         73        SUB                                              ~55     !12, 1
         74        SEND_VAL                                                 ~55
         75        DO_ICALL                                         $56     
         76        SEND_VAR                                                 $56
         77        DO_ICALL                                         $57     
         78        ASSIGN_OP                                     8          !3, $57
         79        INIT_FCALL                                               'substr'
         80        SEND_VAR                                                 !11
         81        SUB                                              ~59     !12, 1
         82        SEND_VAL                                                 ~59
         83        DO_ICALL                                         $60     
         84        ASSIGN                                                   !11, $60
         85    >   ASSIGN                                                   !13, <false>
         86        ASSIGN                                                   !14, 0
         87      > JMP                                                      ->112
         88    >   INIT_FCALL                                               'trim'
         89        FETCH_DIM_R                                      ~64     !9, !14
         90        SEND_VAL                                                 ~64
         91        DO_ICALL                                         $65     
         92        ASSIGN                                                   !15, $65
         93        INIT_FCALL                                               'preg_match'
         94        CONCAT                                           ~67     '%23%5E%3C%5C%2F%3F', !15
         95        CONCAT                                           ~68     ~67, '%5B%3E+%5D%23i'
         96        SEND_VAL                                                 ~68
         97        SEND_VAR                                                 !11
         98        DO_ICALL                                         $69     
         99      > JMPZ                                                     $69, ->111
        100    >   INIT_FCALL                                               'preg_match'
        101        CONCAT                                           ~70     '%23%5E%3C%5C%2F%3F', !15
        102        CONCAT                                           ~71     ~70, '+.%2A%3F%28style%5B+%5D%2A%3F%3D%7Con%5B%5Cw%5D%2B%5B+%5D%2A%3F%3D%29%23i'
        103        SEND_VAL                                                 ~71
        104        SEND_VAR                                                 !11
        105        DO_ICALL                                         $72     
        106      > JMPZ                                                     $72, ->109
        107    >   QM_ASSIGN                                        ~73     <false>
        108      > JMP                                                      ->110
        109    >   QM_ASSIGN                                        ~73     <true>
        110    >   ASSIGN                                                   !13, ~73
        111    >   PRE_INC                                                  !14
        112    >   COUNT                                            ~76     !9
        113        IS_SMALLER                                               !14, ~76
        114      > JMPNZ                                                    ~77, ->88
        115    > > JMPZ_EX                                          ~78     !10, ->118
        116    >   BOOL_NOT                                         ~79     !13
        117        BOOL                                             ~78     ~79
        118    > > JMPZ                                                     ~78, ->126
        119    >   INIT_FCALL                                               'preg_replace'
        120        SEND_VAR                                                 !4
        121        SEND_VAR                                                 !5
        122        SEND_VAR                                                 !11
        123        DO_ICALL                                         $80     
        124        QM_ASSIGN                                        ~81     $80
        125      > JMP                                                      ->127
        126    >   QM_ASSIGN                                        ~81     !11
        127    >   ASSIGN_OP                                     8          !3, ~81
        128        ASSIGN_OP                                     1          !2, !10
        129      > JMP                                                      ->145
        130    >   INIT_FCALL                                               'preg_replace'
        131        SEND_VAR                                                 !4
        132        SEND_VAR                                                 !5
        133        INIT_FCALL                                               'substr'
        134        SEND_VAR                                                 !0
        135        SEND_VAR                                                 !2
        136        STRLEN                                           ~84     !0
        137        SEND_VAL                                                 ~84
        138        DO_ICALL                                         $85     
        139        SEND_VAR                                                 $85
        140        DO_ICALL                                         $86     
        141        ASSIGN_OP                                     8          !3, $86
        142        STRLEN                                           ~88     !0
        143        ASSIGN                                                   !2, ~88
        144        ASSIGN                                                   !1, !2
        145    >   INIT_FCALL                                               'strpos'
        146        SEND_VAR                                                 !0
        147        SEND_VAL                                                 '%3C'
        148        SEND_VAR                                                 !2
        149        DO_ICALL                                         $91     
        150        ASSIGN                                           ~92     !2, $91
        151      > JMPNZ                                                    ~92, ->29
        152    >   STRLEN                                           ~93     !0
        153        IS_NOT_EQUAL                                     ~94     !1, ~93
        154      > JMPZ_EX                                          ~94     ~94, ->157
        155    >   IS_NOT_EQUAL                                     ~95     !3, ''
        156        BOOL                                             ~94     ~95
        157    > > JMPZ                                                     ~94, ->169
        158    >   INIT_FCALL                                               'preg_replace'
        159        SEND_VAR                                                 !4
        160        SEND_VAR                                                 !5
        161        INIT_FCALL                                               'substr'
        162        SEND_VAR                                                 !0
        163        ADD                                              ~96     !1, 1
        164        SEND_VAL                                                 ~96
        165        DO_ICALL                                         $97     
        166        SEND_VAR                                                 $97
        167        DO_ICALL                                         $98     
        168        ASSIGN_OP                                     8          !3, $98
        169    >   IS_NOT_EQUAL                                             !3, ''
        170      > JMPZ                                                     ~100, ->176
        171    >   INIT_FCALL                                               'trim'
        172        SEND_VAR                                                 !3
        173        DO_ICALL                                         $101    
        174        QM_ASSIGN                                        ~102    $101
        175      > JMP                                                      ->180
        176    >   INIT_FCALL                                               'trim'
        177        SEND_VAR                                                 !0
        178        DO_ICALL                                         $103    
        179        QM_ASSIGN                                        ~102    $103
        180    >   ASSIGN                                                   !0, ~102
        181      > JMP                                                      ->188
        182    >   INIT_FCALL                                               'preg_replace'
        183        SEND_VAR                                                 !4
        184        SEND_VAR                                                 !5
        185        SEND_VAR                                                 !0
        186        DO_ICALL                                         $105    
        187        ASSIGN                                                   !0, $105
        188    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
283.94 ms | 1412 KiB | 26 Q