3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<EOD <h1>Escape HTML or Other Programming tags</h1> <p>This must be rendered without any problem</p> <p> <code style="display:block;background:rgb(230,230,230);padding:2%"> <h4>Show this title in HTML</h4> <p>This paragraph must be in <strong>HTML</strong> and this <a href="">Link</a> too !</p> <?php echo "Display this PHP code!"; ?> <script> alert("Don't pop-up please!"); </script> </code> <a href="">Link rendered</a> </p> EOD; $dom = new DOMDocument; $dom->loadHTML($html); $xpath = new DOMXPath($dom); foreach ($xpath->query("//code") as $codeNode) { $codeContent = ''; while ($codeNode->hasChildNodes()) { $codeChild = $codeNode->firstChild; $codeContent .= $dom->saveHTML($codeChild); $codeNode->removeChild($codeChild); } $codeNode->textContent = $codeContent; } $texte = $dom->saveHTML(); echo $texte;

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)
8.3.60.0070.01118.93
8.3.50.0040.01117.02
8.3.40.0040.01119.25
8.3.30.0090.00919.21
8.3.20.0040.00424.18
8.3.10.0110.00324.66
8.3.00.0040.00426.16
8.2.180.0160.00625.92
8.2.170.0230.00019.48
8.2.160.0070.00722.96
8.2.150.0080.00025.66
8.2.140.0040.00424.66
8.2.130.0030.00526.16
8.2.120.0040.00426.35
8.2.110.0100.00022.49
8.2.100.0120.00018.41
8.2.90.0030.00518.41
8.2.80.0030.00619.64
8.2.70.0050.00318.24
8.2.60.0080.00018.53
8.2.50.0050.00318.10
8.2.40.0040.00521.24
8.2.30.0080.00320.17
8.2.20.0080.00419.67
8.2.10.0080.00520.16
8.2.00.0070.00619.40
8.1.280.0070.01425.92
8.1.270.0030.00622.65
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0050.00524.27
8.1.230.0000.01123.10
8.1.220.0030.00518.16
8.1.210.0000.00919.13
8.1.200.0070.00317.63
8.1.190.0040.00417.63
8.1.180.0030.00618.10
8.1.170.0120.00318.87
8.1.160.0100.00319.05
8.1.150.0080.00519.02
8.1.140.0090.00419.00
8.1.130.0100.00319.16
8.1.120.0080.00418.54
8.1.110.0100.00318.54
8.1.100.0080.00619.15
8.1.90.0060.00718.59
8.1.80.0120.00118.61
8.1.70.0110.00218.54
8.1.60.0090.00518.72
8.1.50.0120.00218.60
8.1.40.0080.00718.70
8.1.30.0140.00118.78
8.1.20.0130.00318.67
8.1.10.0060.01018.63
8.1.00.0130.00318.64
8.0.300.0040.00422.44
8.0.290.0040.00417.13
8.0.280.0050.00818.58
8.0.270.0070.00517.70
8.0.260.0120.00018.62
8.0.250.0090.00417.98
8.0.240.0120.00218.04
8.0.230.0090.00418.11
8.0.220.0090.00417.95
8.0.210.0080.00518.01
8.0.200.0080.00518.00
8.0.190.0090.00418.02
8.0.180.0110.00318.01
8.0.170.0090.00518.07
8.0.160.0100.00417.98
8.0.150.0090.00517.95
8.0.140.0070.00617.85
8.0.130.0090.00316.78
8.0.120.0090.00418.00
8.0.110.0100.00317.99
8.0.100.0110.00317.91
8.0.90.0100.00417.97
8.0.80.0090.00717.74
8.0.70.0110.00418.46
8.0.60.0100.00417.86
8.0.50.0070.00618.01
8.0.30.0130.00217.98
8.0.20.0090.00817.93
8.0.10.0120.00517.96
8.0.00.0090.00718.42
7.4.330.0060.00216.11
7.4.320.0080.00517.56
7.4.300.0050.00617.66
7.4.290.0110.00117.54
7.4.280.0070.00717.61
7.4.270.0050.00817.56
7.4.260.0070.00516.44
7.4.250.0070.00517.62
7.4.240.0100.00217.54
7.4.230.0060.00517.51
7.4.220.0050.00517.34
7.4.210.0060.01017.35
7.4.200.0080.00517.51
7.4.190.0130.00018.10
7.4.180.0090.00517.95
7.4.160.0070.00717.94
7.4.150.0100.00617.62
7.4.140.0100.00617.71
7.4.130.0130.00417.59
7.4.120.0080.00917.58
7.4.110.0090.00618.06
7.4.100.0100.00717.68
7.4.90.0100.00718.01
7.4.80.0080.00717.62
7.4.70.0170.00917.64
7.4.60.0130.00417.64
7.4.50.0140.00417.54
7.4.40.0130.00317.58
7.4.30.0120.00517.69
7.4.20.0090.00617.56
7.4.10.0100.00617.57
7.4.00.0100.00517.57
7.3.330.0070.00717.43
7.3.320.0090.00416.39
7.3.310.0080.00417.40
7.3.300.0080.00517.39
7.3.290.0110.00617.01
7.3.280.0140.00217.76
7.3.270.0050.01117.59
7.3.260.0120.00517.58
7.3.250.0130.00417.62
7.3.240.0080.00817.56
7.3.230.0110.00617.58
7.3.220.0120.00517.54
7.3.210.0130.00417.55
7.3.200.0130.00717.54
7.3.190.0110.00917.89
7.3.180.0110.00717.56
7.3.170.0130.00417.55
7.3.160.0100.00717.54
7.3.150.0100.00717.98
7.3.140.0100.00718.00
7.3.130.0140.00317.56
7.3.120.0090.00817.94
7.3.110.0120.00517.52
7.3.100.0100.00717.51
7.3.90.0080.00917.75
7.3.80.0100.00617.57
7.3.70.0110.00617.57
7.3.60.0100.00717.59
7.3.50.0130.00518.04
7.3.40.0100.00817.63
7.3.30.0080.00917.61
7.3.20.0100.00718.40
7.3.10.0130.00518.43
7.3.00.0100.00818.47

preferences:
50.31 ms | 400 KiB | 5 Q