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(',', $board_config['allow_html_tags']); $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 = 184
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 147
Branch analysis from position: 147
2 jumps found. (Code = 44) Position 1 = 154, Position 2 = 31
Branch analysis from position: 154
2 jumps found. (Code = 46) Position 1 = 157, Position 2 = 159
Branch analysis from position: 157
2 jumps found. (Code = 43) Position 1 = 160, Position 2 = 171
Branch analysis from position: 160
2 jumps found. (Code = 43) Position 1 = 173, Position 2 = 178
Branch analysis from position: 173
1 jumps found. (Code = 42) Position 1 = 182
Branch analysis from position: 182
1 jumps found. (Code = 42) Position 1 = 190
Branch analysis from position: 190
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 178
1 jumps found. (Code = 42) Position 1 = 190
Branch analysis from position: 190
Branch analysis from position: 171
Branch analysis from position: 159
Branch analysis from position: 31
2 jumps found. (Code = 43) Position 1 = 52, Position 2 = 132
Branch analysis from position: 52
2 jumps found. (Code = 43) Position 1 = 69, Position 2 = 87
Branch analysis from position: 69
1 jumps found. (Code = 42) Position 1 = 114
Branch analysis from position: 114
2 jumps found. (Code = 44) Position 1 = 117, Position 2 = 90
Branch analysis from position: 117
2 jumps found. (Code = 46) Position 1 = 118, Position 2 = 120
Branch analysis from position: 118
2 jumps found. (Code = 43) Position 1 = 121, Position 2 = 128
Branch analysis from position: 121
1 jumps found. (Code = 42) Position 1 = 129
Branch analysis from position: 129
1 jumps found. (Code = 42) Position 1 = 147
Branch analysis from position: 147
Branch analysis from position: 128
1 jumps found. (Code = 42) Position 1 = 147
Branch analysis from position: 147
Branch analysis from position: 120
Branch analysis from position: 90
2 jumps found. (Code = 43) Position 1 = 102, Position 2 = 113
Branch analysis from position: 102
2 jumps found. (Code = 43) Position 1 = 109, Position 2 = 111
Branch analysis from position: 109
1 jumps found. (Code = 42) Position 1 = 112
Branch analysis from position: 112
2 jumps found. (Code = 44) Position 1 = 117, Position 2 = 90
Branch analysis from position: 117
Branch analysis from position: 90
Branch analysis from position: 111
2 jumps found. (Code = 44) Position 1 = 117, Position 2 = 90
Branch analysis from position: 117
Branch analysis from position: 90
Branch analysis from position: 113
Branch analysis from position: 87
Branch analysis from position: 132
2 jumps found. (Code = 44) Position 1 = 154, Position 2 = 31
Branch analysis from position: 154
Branch analysis from position: 31
Branch analysis from position: 184
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/u2AFG
function name:  (null)
number of ops:  191
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 = $board_config, !11 = $length, !12 = $hold_string, !13 = $unclosed_open, !14 = $tagallowed, !15 = $i, !16 = $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                                           ~21     '+', !0
          5        CONCAT                                           ~22     ~21, '+'
          6        ASSIGN                                                   !0, ~22
          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                                         $29     
         15        ASSIGN                                                   !0, $29
         16      > JMPZ                                                     !6, ->184
         17    >   INIT_FCALL_BY_NAME                                       'split'
         18        SEND_VAL_EX                                              '%2C'
         19        CHECK_FUNC_ARG                                           
         20        FETCH_DIM_FUNC_ARG                               $31     !10, 'allow_html_tags'
         21        SEND_FUNC_ARG                                            $31
         22        DO_FCALL                                      0  $32     
         23        ASSIGN                                                   !9, $32
         24        ASSIGN                                                   !1, 0
         25        ASSIGN                                                   !2, 1
         26        ASSIGN                                                   !3, ''
         27        CONCAT                                           ~37     '+', !0
         28        CONCAT                                           ~38     ~37, '+'
         29        ASSIGN                                                   !0, ~38
         30      > JMP                                                      ->147
         31    >   INIT_FCALL                                               'preg_replace'
         32        SEND_VAR                                                 !4
         33        SEND_VAR                                                 !5
         34        INIT_FCALL                                               'substr'
         35        SEND_VAR                                                 !0
         36        ADD                                              ~40     !1, 1
         37        SEND_VAL                                                 ~40
         38        SUB                                              ~41     !2, !1
         39        SUB                                              ~42     ~41, 1
         40        SEND_VAL                                                 ~42
         41        DO_ICALL                                         $43     
         42        SEND_VAR                                                 $43
         43        DO_ICALL                                         $44     
         44        ASSIGN_OP                                     8          !3, $44
         45        INIT_FCALL                                               'strpos'
         46        SEND_VAR                                                 !0
         47        SEND_VAL                                                 '%3E'
         48        SEND_VAR                                                 !2
         49        DO_ICALL                                         $46     
         50        ASSIGN                                           ~47     !1, $46
         51      > JMPZ                                                     ~47, ->132
         52    >   SUB                                              ~48     !1, !2
         53        ADD                                              ~49     ~48, 1
         54        ASSIGN                                                   !11, ~49
         55        INIT_FCALL                                               'substr'
         56        SEND_VAR                                                 !0
         57        SEND_VAR                                                 !2
         58        SEND_VAR                                                 !11
         59        DO_ICALL                                         $51     
         60        ASSIGN                                                   !12, $51
         61        INIT_FCALL                                               'strrpos'
         62        CONCAT                                           ~53     '+', !12
         63        SEND_VAL                                                 ~53
         64        SEND_VAL                                                 '%3C'
         65        DO_ICALL                                         $54     
         66        ASSIGN                                           ~55     !13, $54
         67        IS_NOT_EQUAL                                             ~55, 1
         68      > JMPZ                                                     ~56, ->87
         69    >   INIT_FCALL                                               'preg_replace'
         70        SEND_VAR                                                 !4
         71        SEND_VAR                                                 !5
         72        INIT_FCALL                                               'substr'
         73        SEND_VAR                                                 !12
         74        SEND_VAL                                                 0
         75        SUB                                              ~57     !13, 1
         76        SEND_VAL                                                 ~57
         77        DO_ICALL                                         $58     
         78        SEND_VAR                                                 $58
         79        DO_ICALL                                         $59     
         80        ASSIGN_OP                                     8          !3, $59
         81        INIT_FCALL                                               'substr'
         82        SEND_VAR                                                 !12
         83        SUB                                              ~61     !13, 1
         84        SEND_VAL                                                 ~61
         85        DO_ICALL                                         $62     
         86        ASSIGN                                                   !12, $62
         87    >   ASSIGN                                                   !14, <false>
         88        ASSIGN                                                   !15, 0
         89      > JMP                                                      ->114
         90    >   INIT_FCALL                                               'trim'
         91        FETCH_DIM_R                                      ~66     !9, !15
         92        SEND_VAL                                                 ~66
         93        DO_ICALL                                         $67     
         94        ASSIGN                                                   !16, $67
         95        INIT_FCALL                                               'preg_match'
         96        CONCAT                                           ~69     '%23%5E%3C%5C%2F%3F', !16
         97        CONCAT                                           ~70     ~69, '%5B%3E+%5D%23i'
         98        SEND_VAL                                                 ~70
         99        SEND_VAR                                                 !12
        100        DO_ICALL                                         $71     
        101      > JMPZ                                                     $71, ->113
        102    >   INIT_FCALL                                               'preg_match'
        103        CONCAT                                           ~72     '%23%5E%3C%5C%2F%3F', !16
        104        CONCAT                                           ~73     ~72, '+.%2A%3F%28style%5B+%5D%2A%3F%3D%7Con%5B%5Cw%5D%2B%5B+%5D%2A%3F%3D%29%23i'
        105        SEND_VAL                                                 ~73
        106        SEND_VAR                                                 !12
        107        DO_ICALL                                         $74     
        108      > JMPZ                                                     $74, ->111
        109    >   QM_ASSIGN                                        ~75     <false>
        110      > JMP                                                      ->112
        111    >   QM_ASSIGN                                        ~75     <true>
        112    >   ASSIGN                                                   !14, ~75
        113    >   PRE_INC                                                  !15
        114    >   COUNT                                            ~78     !9
        115        IS_SMALLER                                               !15, ~78
        116      > JMPNZ                                                    ~79, ->90
        117    > > JMPZ_EX                                          ~80     !11, ->120
        118    >   BOOL_NOT                                         ~81     !14
        119        BOOL                                             ~80     ~81
        120    > > JMPZ                                                     ~80, ->128
        121    >   INIT_FCALL                                               'preg_replace'
        122        SEND_VAR                                                 !4
        123        SEND_VAR                                                 !5
        124        SEND_VAR                                                 !12
        125        DO_ICALL                                         $82     
        126        QM_ASSIGN                                        ~83     $82
        127      > JMP                                                      ->129
        128    >   QM_ASSIGN                                        ~83     !12
        129    >   ASSIGN_OP                                     8          !3, ~83
        130        ASSIGN_OP                                     1          !2, !11
        131      > JMP                                                      ->147
        132    >   INIT_FCALL                                               'preg_replace'
        133        SEND_VAR                                                 !4
        134        SEND_VAR                                                 !5
        135        INIT_FCALL                                               'substr'
        136        SEND_VAR                                                 !0
        137        SEND_VAR                                                 !2
        138        STRLEN                                           ~86     !0
        139        SEND_VAL                                                 ~86
        140        DO_ICALL                                         $87     
        141        SEND_VAR                                                 $87
        142        DO_ICALL                                         $88     
        143        ASSIGN_OP                                     8          !3, $88
        144        STRLEN                                           ~90     !0
        145        ASSIGN                                                   !2, ~90
        146        ASSIGN                                                   !1, !2
        147    >   INIT_FCALL                                               'strpos'
        148        SEND_VAR                                                 !0
        149        SEND_VAL                                                 '%3C'
        150        SEND_VAR                                                 !2
        151        DO_ICALL                                         $93     
        152        ASSIGN                                           ~94     !2, $93
        153      > JMPNZ                                                    ~94, ->31
        154    >   STRLEN                                           ~95     !0
        155        IS_NOT_EQUAL                                     ~96     !1, ~95
        156      > JMPZ_EX                                          ~96     ~96, ->159
        157    >   IS_NOT_EQUAL                                     ~97     !3, ''
        158        BOOL                                             ~96     ~97
        159    > > JMPZ                                                     ~96, ->171
        160    >   INIT_FCALL                                               'preg_replace'
        161        SEND_VAR                                                 !4
        162        SEND_VAR                                                 !5
        163        INIT_FCALL                                               'substr'
        164        SEND_VAR                                                 !0
        165        ADD                                              ~98     !1, 1
        166        SEND_VAL                                                 ~98
        167        DO_ICALL                                         $99     
        168        SEND_VAR                                                 $99
        169        DO_ICALL                                         $100    
        170        ASSIGN_OP                                     8          !3, $100
        171    >   IS_NOT_EQUAL                                             !3, ''
        172      > JMPZ                                                     ~102, ->178
        173    >   INIT_FCALL                                               'trim'
        174        SEND_VAR                                                 !3
        175        DO_ICALL                                         $103    
        176        QM_ASSIGN                                        ~104    $103
        177      > JMP                                                      ->182
        178    >   INIT_FCALL                                               'trim'
        179        SEND_VAR                                                 !0
        180        DO_ICALL                                         $105    
        181        QM_ASSIGN                                        ~104    $105
        182    >   ASSIGN                                                   !0, ~104
        183      > JMP                                                      ->190
        184    >   INIT_FCALL                                               'preg_replace'
        185        SEND_VAR                                                 !4
        186        SEND_VAR                                                 !5
        187        SEND_VAR                                                 !0
        188        DO_ICALL                                         $107    
        189        ASSIGN                                                   !0, $107
        190    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.08 ms | 1412 KiB | 25 Q