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>");

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.4.260.0070.05719.00
5.4.250.0070.05718.95
5.4.240.0070.08018.66
5.4.230.0030.06018.84
5.4.220.0000.06019.00
5.4.210.0070.05318.84
5.4.200.0200.04718.80
5.4.190.0000.05719.09
5.4.180.0130.04718.99
5.4.170.0170.07018.76
5.4.160.0130.05018.79
5.4.150.0100.05318.79
5.4.140.0130.05016.39
5.4.130.0100.05316.38
5.4.120.0070.05716.39
5.4.110.0070.05716.52
5.4.100.0070.06716.41
5.4.90.0030.07716.41
5.4.80.0230.05716.47
5.4.70.0070.05016.47
5.4.60.0070.05016.34
5.4.50.0070.05316.46
5.4.40.0070.05016.58
5.4.30.0030.07316.50
5.4.20.0070.05316.48
5.4.10.0130.06716.49
5.4.00.0170.05715.94
5.3.280.0170.04314.50
5.3.270.0130.05714.67
5.3.260.0130.05014.63
5.3.250.0070.08014.68
5.3.240.0000.06714.59
5.3.230.0200.05014.68
5.3.220.0130.05014.56
5.3.210.0070.05014.65
5.3.200.0100.05014.63
5.3.190.0030.06314.70
5.3.180.0030.07314.79
5.3.170.0030.05314.63
5.3.160.0200.05714.63
5.3.150.0130.05714.58
5.3.140.0070.05014.78
5.3.130.0100.07314.52
5.3.120.0130.07014.63
5.3.110.0130.04714.63
5.3.100.0030.05714.14
5.3.90.0000.06013.99
5.3.80.0070.05713.93
5.3.70.0130.06014.11
5.3.60.0130.05714.11
5.3.50.0100.04713.77
5.3.40.0130.06314.11
5.3.30.0130.04714.00
5.3.20.0070.05013.78
5.3.10.0070.05013.73
5.3.00.0100.06313.73
5.2.170.0070.04011.21
5.2.160.0030.04311.30
5.2.150.0030.05310.97
5.2.140.0130.04010.96
5.2.130.0070.04311.32
5.2.120.0100.03711.05
5.2.110.0100.03711.09
5.2.100.0030.04711.05
5.2.90.0100.05310.92
5.2.80.0070.06011.01
5.2.70.0100.04711.17
5.2.60.0030.04311.05
5.2.50.0130.03711.02
5.2.40.0200.04010.99
5.2.30.0000.05711.04
5.2.20.0030.04011.05
5.2.10.0000.04310.82
5.2.00.0070.03710.82
5.1.60.0070.03010.24
5.1.50.0070.03310.06
5.1.40.0100.0439.98
5.1.30.0000.04010.18
5.1.20.0030.03710.43
5.1.10.0030.03310.05
5.1.00.0030.03710.14
5.0.50.0000.0438.60
5.0.40.0000.0308.67
5.0.30.0000.0438.19
5.0.20.0030.0378.42
5.0.10.0030.0278.25
5.0.00.0000.0438.27
4.4.90.0030.0235.84
4.4.80.0100.0135.86
4.4.70.0000.0235.82
4.4.60.0030.0205.84
4.4.50.0000.0275.88
4.4.40.0000.0375.87
4.4.30.0030.0205.89
4.4.20.0030.0306.04
4.4.10.0030.0205.89
4.4.00.0000.0335.90
4.3.110.0030.0205.83
4.3.100.0100.0235.86
4.3.90.0000.0205.79
4.3.80.0000.0335.79
4.3.70.0030.0305.76
4.3.60.0000.0205.77
4.3.50.0030.0205.79
4.3.40.0030.0335.73
4.3.30.0000.0235.69
4.3.20.0000.0275.65
4.3.10.0030.0205.64
4.3.00.0030.0277.04

preferences:
139.45 ms | 1394 KiB | 7 Q