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);
Output for git.master, git.master_jit, rfc.property-hooks
Warning: Undefined variable $waarde in /in/U62nS on line 68 Deprecated: nl2br(): Passing null to parameter #1 ($string) of type string is deprecated in /in/U62nS on line 68 Warning: Undefined variable $GeenSmilies in /in/U62nS on line 70 Warning: foreach() argument must be of type array|object, null given in /in/U62nS on line 70

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
35.61 ms | 401 KiB | 8 Q