3v4l.org

run code in 300+ PHP versions simultaneously
<?php $htmlentitiesTabel = get_html_translation_table(HTML_ENTITIES); function Kleuren($code) { global $htmlentitiesTabel; $code = trim($code); $aantal = substr_count($code,"\n")+1; $gekleurd = highlight_string($code,true); $gekleurd = str_replace(array('<font ', '</font>'), array('<span ', '</span>'), $gekleurd); $gekleurd = preg_replace('#color="(.*?)"#', 'style="color: \\1"', $gekleurd); $tabel = $htmlentitiesTabel; unset($tabel['<']); unset($tabel['>']); unset($tabel['&']); unset($tabel['\'']); unset($tabel['"']); $gekleurd = strtr($gekleurd, $tabel); $breedte = strlen($aantal)*7; $hoogteblok = $aantal > 25 ? "308" : $aantal*12+26; $hoogteregels = $aantal*12+16; $blok = "<div class='Codeblok' style='height: $hoogteblok"."px".($aantal <= 25 ? "; overflow-y: hidden" : "")."'> <table cellpadding='0' cellspacing='0'> <tr> <td class='CodeblokRegels' style='height: $hoogteregels"."px; width: $breedte"."px'> <code>"; for($i = 1; $i <= $aantal; $i++) { $blok .= "$i<br>"; } $blok .= " </code> </td> <td class='CodeblokCode'> $gekleurd </td> </tr> </table> </div>"; return $blok; } function Tekst($waarde) { global $htmlentitiesTabel; $waarde = str_replace("§","&sect;",$waarde); preg_match_all("#\[code\](.*?)\[/code\](\r)?(\n)?#is", $waarde, $GeenSmilies['code']); preg_match_all("#\[php\](.*?)\[/php\](\r)?(\n)?#is", $waarde, $GeenSmilies['php']); foreach($GeenSmilies as $i => $code) { foreach($code[0] as $nr => $tekst) { $waarde = str_replace($tekst,"§".$i.$nr."§",$waarde); } } $waarde = htmlentities($waarde,ENT_QUOTES); } // Smilies vervangen // UBB-codes vervangen $waarde = nl2br($waarde); foreach($GeenSmilies as $i => $code) { foreach($code[1] as $nr => $tekst) { $waarde = str_replace("&sect;$i$nr&sect;",Kleuren($tekst),$waarde); } } $waarde = str_replace("&amp;sect;","&sect;",$waarde);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 31
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 31
Branch analysis from position: 10
2 jumps found. (Code = 77) Position 1 = 13, Position 2 = 29
Branch analysis from position: 13
2 jumps found. (Code = 78) Position 1 = 14, Position 2 = 29
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
Branch analysis from position: 29
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 29
Branch analysis from position: 31
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
filename:       /in/U62nS
function name:  (null)
number of ops:  39
compiled vars:  !0 = $htmlentitiesTabel, !1 = $waarde, !2 = $GeenSmilies, !3 = $code, !4 = $i, !5 = $tekst, !6 = $nr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'get_html_translation_table'
          1        SEND_VAL                                                 1
          2        DO_ICALL                                         $7      
          3        ASSIGN                                                   !0, $7
   68     4        INIT_FCALL                                               'nl2br'
          5        SEND_VAR                                                 !1
          6        DO_ICALL                                         $9      
          7        ASSIGN                                                   !1, $9
   70     8      > FE_RESET_R                                       $11     !2, ->31
          9    > > FE_FETCH_R                                       ~12     $11, !3, ->31
         10    >   ASSIGN                                                   !4, ~12
   71    11        FETCH_DIM_R                                      ~14     !3, 1
         12      > FE_RESET_R                                       $15     ~14, ->29
         13    > > FE_FETCH_R                                       ~16     $15, !5, ->29
         14    >   ASSIGN                                                   !6, ~16
   72    15        INIT_FCALL                                               'str_replace'
         16        ROPE_INIT                                     4  ~19     '%26sect%3B'
         17        ROPE_ADD                                      1  ~19     ~19, !4
         18        ROPE_ADD                                      2  ~19     ~19, !6
         19        ROPE_END                                      3  ~18     ~19, '%26sect%3B'
         20        SEND_VAL                                                 ~18
         21        INIT_FCALL                                               'kleuren'
         22        SEND_VAR                                                 !5
         23        DO_FCALL                                      0  $21     
         24        SEND_VAR                                                 $21
         25        SEND_VAR                                                 !1
         26        DO_ICALL                                         $22     
         27        ASSIGN                                                   !1, $22
   71    28      > JMP                                                      ->13
         29    >   FE_FREE                                                  $15
   70    30      > JMP                                                      ->9
         31    >   FE_FREE                                                  $11
   75    32        INIT_FCALL                                               'str_replace'
         33        SEND_VAL                                                 '%26amp%3Bsect%3B'
         34        SEND_VAL                                                 '%26sect%3B'
         35        SEND_VAR                                                 !1
         36        DO_ICALL                                         $24     
         37        ASSIGN                                                   !1, $24
         38      > RETURN                                                   1

Function kleuren:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 45, Position 2 = 47
Branch analysis from position: 45
1 jumps found. (Code = 42) Position 1 = 50
Branch analysis from position: 50
2 jumps found. (Code = 43) Position 1 = 59, Position 2 = 61
Branch analysis from position: 59
1 jumps found. (Code = 42) Position 1 = 62
Branch analysis from position: 62
1 jumps found. (Code = 42) Position 1 = 77
Branch analysis from position: 77
2 jumps found. (Code = 44) Position 1 = 79, Position 2 = 73
Branch analysis from position: 79
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 73
2 jumps found. (Code = 44) Position 1 = 79, Position 2 = 73
Branch analysis from position: 79
Branch analysis from position: 73
Branch analysis from position: 61
1 jumps found. (Code = 42) Position 1 = 77
Branch analysis from position: 77
Branch analysis from position: 47
2 jumps found. (Code = 43) Position 1 = 59, Position 2 = 61
Branch analysis from position: 59
Branch analysis from position: 61
filename:       /in/U62nS
function name:  Kleuren
number of ops:  85
compiled vars:  !0 = $code, !1 = $htmlentitiesTabel, !2 = $aantal, !3 = $gekleurd, !4 = $tabel, !5 = $breedte, !6 = $hoogteblok, !7 = $hoogteregels, !8 = $blok, !9 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV                                             !0      
    6     1        BIND_GLOBAL                                              !1, 'htmlentitiesTabel'
    8     2        INIT_FCALL                                               'trim'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $10     
          5        ASSIGN                                                   !0, $10
    9     6        INIT_FCALL                                               'substr_count'
          7        SEND_VAR                                                 !0
          8        SEND_VAL                                                 '%0A'
          9        DO_ICALL                                         $12     
         10        ADD                                              ~13     $12, 1
         11        ASSIGN                                                   !2, ~13
   10    12        INIT_FCALL                                               'highlight_string'
         13        SEND_VAR                                                 !0
         14        SEND_VAL                                                 <true>
         15        DO_ICALL                                         $15     
         16        ASSIGN                                                   !3, $15
   11    17        INIT_FCALL                                               'str_replace'
         18        SEND_VAL                                                 <array>
         19        SEND_VAL                                                 <array>
         20        SEND_VAR                                                 !3
         21        DO_ICALL                                         $17     
         22        ASSIGN                                                   !3, $17
   12    23        INIT_FCALL                                               'preg_replace'
         24        SEND_VAL                                                 '%23color%3D%22%28.%2A%3F%29%22%23'
         25        SEND_VAL                                                 'style%3D%22color%3A+%5C1%22'
         26        SEND_VAR                                                 !3
         27        DO_ICALL                                         $19     
         28        ASSIGN                                                   !3, $19
   14    29        ASSIGN                                                   !4, !1
   15    30        UNSET_DIM                                                !4, '%3C'
   16    31        UNSET_DIM                                                !4, '%3E'
   17    32        UNSET_DIM                                                !4, '%26'
   18    33        UNSET_DIM                                                !4, '%27'
   19    34        UNSET_DIM                                                !4, '%22'
   20    35        INIT_FCALL                                               'strtr'
         36        SEND_VAR                                                 !3
         37        SEND_VAR                                                 !4
         38        DO_ICALL                                         $22     
         39        ASSIGN                                                   !3, $22
   22    40        STRLEN                                           ~24     !2
         41        MUL                                              ~25     ~24, 7
         42        ASSIGN                                                   !5, ~25
   23    43        IS_SMALLER                                               25, !2
         44      > JMPZ                                                     ~27, ->47
         45    >   QM_ASSIGN                                        ~28     '308'
         46      > JMP                                                      ->50
         47    >   MUL                                              ~29     !2, 12
         48        ADD                                              ~30     ~29, 26
         49        QM_ASSIGN                                        ~28     ~30
         50    >   ASSIGN                                                   !6, ~28
   24    51        MUL                                              ~32     !2, 12
         52        ADD                                              ~33     ~32, 16
         53        ASSIGN                                                   !7, ~33
   26    54        NOP                                                      
         55        FAST_CONCAT                                      ~35     '%3Cdiv+class%3D%27Codeblok%27+style%3D%27height%3A+', !6
         56        CONCAT                                           ~36     ~35, 'px'
         57        IS_SMALLER_OR_EQUAL                                      !2, 25
         58      > JMPZ                                                     ~37, ->61
         59    >   QM_ASSIGN                                        ~38     '%3B+overflow-y%3A+hidden'
         60      > JMP                                                      ->62
         61    >   QM_ASSIGN                                        ~38     ''
         62    >   CONCAT                                           ~39     ~36, ~38
         63        NOP                                                      
   29    64        FAST_CONCAT                                      ~40     '%27%3E%0A++++++++%3Ctable+cellpadding%3D%270%27+cellspacing%3D%270%27%3E%0A++++++++++++%3Ctr%3E%0A++++++++++++++++%3Ctd+class%3D%27CodeblokRegels%27+style%3D%27height%3A+', !7
         65        CONCAT                                           ~41     ~39, ~40
         66        NOP                                                      
         67        FAST_CONCAT                                      ~42     'px%3B+width%3A+', !5
         68        CONCAT                                           ~43     ~41, ~42
         69        CONCAT                                           ~44     ~43, 'px%27%3E%0A++++++++++++++++++++%3Ccode%3E'
   26    70        ASSIGN                                                   !8, ~44
   32    71        ASSIGN                                                   !9, 1
         72      > JMP                                                      ->77
   33    73    >   NOP                                                      
         74        FAST_CONCAT                                      ~47     !9, '%3Cbr%3E'
         75        ASSIGN_OP                                     8          !8, ~47
   32    76        PRE_INC                                                  !9
         77    >   IS_SMALLER_OR_EQUAL                                      !9, !2
         78      > JMPNZ                                                    ~50, ->73
   36    79    >   ROPE_INIT                                     3  ~52     '%0A++++++++++++++++++++%3C%2Fcode%3E%0A++++++++++++++++%3C%2Ftd%3E%0A++++++++++++++++%3Ctd+class%3D%27CodeblokCode%27%3E%0A'
   40    80        ROPE_ADD                                      1  ~52     ~52, !3
         81        ROPE_END                                      2  ~51     ~52, '%0A++++++++++++++++%3C%2Ftd%3E%0A++++++++++++%3C%2Ftr%3E%0A++++++++%3C%2Ftable%3E%0A++++%3C%2Fdiv%3E'
         82        ASSIGN_OP                                     8          !8, ~51
   46    83      > RETURN                                                   !8
   47    84*     > RETURN                                                   null

End of function kleuren

Function tekst:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 21, Position 2 = 39
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 39
Branch analysis from position: 22
2 jumps found. (Code = 77) Position 1 = 25, Position 2 = 37
Branch analysis from position: 25
2 jumps found. (Code = 78) Position 1 = 26, Position 2 = 37
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
Branch analysis from position: 37
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 37
Branch analysis from position: 39
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 39
filename:       /in/U62nS
function name:  Tekst
number of ops:  46
compiled vars:  !0 = $waarde, !1 = $htmlentitiesTabel, !2 = $GeenSmilies, !3 = $code, !4 = $i, !5 = $tekst, !6 = $nr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   49     0  E >   RECV                                             !0      
   50     1        BIND_GLOBAL                                              !1, 'htmlentitiesTabel'
   52     2        INIT_FCALL                                               'str_replace'
          3        SEND_VAL                                                 '%C2%A7'
          4        SEND_VAL                                                 '%26sect%3B'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $7      
          7        ASSIGN                                                   !0, $7
   53     8        INIT_FCALL                                               'preg_match_all'
          9        SEND_VAL                                                 '%23%5C%5Bcode%5C%5D%28.%2A%3F%29%5C%5B%2Fcode%5C%5D%28%0D%29%3F%28%0A%29%3F%23is'
         10        SEND_VAR                                                 !0
         11        FETCH_DIM_W                                      $9      !2, 'code'
         12        SEND_REF                                                 $9
         13        DO_ICALL                                                 
   54    14        INIT_FCALL                                               'preg_match_all'
         15        SEND_VAL                                                 '%23%5C%5Bphp%5C%5D%28.%2A%3F%29%5C%5B%2Fphp%5C%5D%28%0D%29%3F%28%0A%29%3F%23is'
         16        SEND_VAR                                                 !0
         17        FETCH_DIM_W                                      $11     !2, 'php'
         18        SEND_REF                                                 $11
         19        DO_ICALL                                                 
   55    20      > FE_RESET_R                                       $13     !2, ->39
         21    > > FE_FETCH_R                                       ~14     $13, !3, ->39
         22    >   ASSIGN                                                   !4, ~14
   56    23        FETCH_DIM_R                                      ~16     !3, 0
         24      > FE_RESET_R                                       $17     ~16, ->37
         25    > > FE_FETCH_R                                       ~18     $17, !5, ->37
         26    >   ASSIGN                                                   !6, ~18
   57    27        INIT_FCALL                                               'str_replace'
         28        SEND_VAR                                                 !5
         29        CONCAT                                           ~20     '%C2%A7', !4
         30        CONCAT                                           ~21     ~20, !6
         31        CONCAT                                           ~22     ~21, '%C2%A7'
         32        SEND_VAL                                                 ~22
         33        SEND_VAR                                                 !0
         34        DO_ICALL                                         $23     
         35        ASSIGN                                                   !0, $23
   56    36      > JMP                                                      ->25
         37    >   FE_FREE                                                  $17
   55    38      > JMP                                                      ->21
         39    >   FE_FREE                                                  $13
   61    40        INIT_FCALL                                               'htmlentities'
         41        SEND_VAR                                                 !0
         42        SEND_VAL                                                 3
         43        DO_ICALL                                         $25     
         44        ASSIGN                                                   !0, $25
   62    45      > RETURN                                                   null

End of function tekst

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
170.03 ms | 1415 KiB | 34 Q