3v4l.org

run code in 300+ PHP versions simultaneously
<?php function fixtags($text){ $text = htmlspecialchars($text); console.log($text); $text = preg_replace("/=/", "=\"\"", $text); console.log($text); $text = preg_replace("/&quot;/", "&quot;\"", $text); console.log($text); $tags = "/&lt;(\/|)(\w*)(\ |)(\w*)([\\\=]*)(?|(\")\"&quot;\"|)(?|(.*)?&quot;(\")|)([\ ]?)(\/|)&gt;/i(\&lt;h[1-9]&gt;)"; $replacement = "<$1$2$3$4$5$6$7$8$9$10>"; $text = preg_replace($tags, $replacement, $text); console.log($text); $text = preg_replace("/=\"\"/", "=", $text); console.log($text); return $text; }?> <?php echo fixtags(" content of website ... <h1> Heading (?= 1 for largest to 6 for smallest, eg h1) </h1> <p> Paragraph of Text </p> <b> Bold Text </b> <a href="url"> ... </a> <i> Italic Text </i> <u> Underline Text </u> <strike> Strikeout </strike> <sup> Superscript - Smaller text placed below normal text </sup> <sub> ... </sub>");
Output for 5.4.0 - 5.4.26
Parse error: syntax error, unexpected 'url' (T_STRING) in /in/cGdWR on line 23
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_STRING in /in/cGdWR on line 23
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_STRING in /in/cGdWR on line 23
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/cGdWR on line 23
Process exited with code 255.

preferences:
208.05 ms | 1395 KiB | 116 Q