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); $preformattedCodeNode = $dom->createElement('pre'); foreach ($xpath->query("//code") as $codeNode) { $codeContent = ''; foreach($codeNode->childNodes as $codeChild) { $codeContent .= $dom->saveHTML($codeChild); } $preformattedCodeNode->textContent = $codeContent; $preformattedCodeNode->setAttribute('style', $codeNode->getAttribute('style')); $codeNode->parentNode->replaceChild($preformattedCodeNode, $codeNode); } $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.5.10.0080.01117.09
8.5.00.0110.00920.40
8.4.160.0150.00724.11
8.4.150.0030.00014.05
8.4.140.0150.00817.94
8.4.130.0120.00818.21
8.4.120.0090.01022.79
8.4.110.0090.01022.82
8.4.100.0170.00418.14
8.4.90.0100.01018.93
8.4.80.0130.00818.45
8.4.70.0060.00318.11
8.4.60.0100.01019.11
8.4.50.0030.00620.66
8.4.40.0040.00420.05
8.4.30.0250.00519.44
8.4.20.0090.00018.10
8.4.10.0160.00326.27
8.3.280.0120.00920.44
8.3.270.0120.01316.95
8.3.260.0100.00916.87
8.3.250.0120.00719.42
8.3.240.0130.00616.85
8.3.230.0080.01217.05
8.3.220.0130.00617.47
8.3.210.0070.00316.97
8.3.200.0030.00616.97
8.3.190.0130.00717.62
8.3.180.0070.00816.87
8.3.170.0050.00317.66
8.3.160.0100.01017.02
8.3.150.0100.01019.40
8.3.140.0130.00617.29
8.3.130.0040.00418.66
8.3.120.0130.00618.97
8.3.110.0160.00317.28
8.3.100.0090.00017.27
8.3.90.0060.00326.77
8.3.80.0070.00419.36
8.3.70.0130.01018.69
8.3.60.0150.00718.57
8.3.50.0130.00823.71
8.3.40.0040.01219.15
8.3.30.0100.01019.26
8.3.20.0060.00324.18
8.3.10.0040.01524.66
8.3.00.0180.00026.16
8.2.290.0130.00620.91
8.2.280.0100.01019.46
8.2.270.0130.00617.61
8.2.260.0150.00016.90
8.2.250.0080.00017.15
8.2.240.0030.00619.18
8.2.230.0120.00420.94
8.2.220.0090.00018.54
8.2.210.0030.00626.77
8.2.200.0070.00318.88
8.2.190.0120.00318.79
8.2.180.0030.01725.92
8.2.170.0070.00719.29
8.2.160.0070.00722.96
8.2.150.0040.00425.66
8.2.140.0000.00924.66
8.2.130.0130.00326.16
8.2.120.0080.00026.35
8.2.110.0030.00622.81
8.2.100.0040.00818.16
8.2.90.0030.00518.34
8.2.80.0040.00418.59
8.2.70.0000.00818.13
8.2.60.0080.00018.00
8.2.50.0030.00518.00
8.2.40.0040.00421.75
8.2.30.0020.00519.76
8.2.20.0070.00018.59
8.2.10.0040.00419.71
8.2.00.0040.00419.63
8.1.330.0130.00424.10
8.1.320.0140.00816.54
8.1.310.0150.00416.93
8.1.300.0100.00618.48
8.1.290.0030.00630.84
8.1.280.0030.01225.92
8.1.270.0080.00024.25
8.1.260.0050.00328.09
8.1.250.0040.00428.09
8.1.240.0110.00019.81
8.1.230.0060.00620.97
8.1.220.0000.00817.91
8.1.210.0030.00519.29
8.1.200.0090.00017.73
8.1.190.0030.00517.73
8.1.180.0000.00918.10
8.1.170.0060.00318.84
8.1.160.0050.00321.04
8.1.150.0000.00819.21
8.1.140.0000.00819.24
8.1.130.0050.00217.84
8.1.120.0080.00017.73
8.1.110.0030.00517.80
8.1.100.0080.00017.76
8.1.90.0000.00817.84
8.1.80.0030.00617.91
8.1.70.0030.00317.78
8.1.60.0000.00817.90
8.1.50.0040.00417.93
8.1.40.0000.00917.83
8.1.30.0030.00617.98
8.1.20.0060.00318.05
8.1.10.0060.00317.96
8.1.00.0030.00617.77
8.0.300.0050.00320.37
8.0.290.0040.00417.25
8.0.280.0070.00018.78
8.0.270.0050.00317.29
8.0.260.0000.00717.30
8.0.250.0030.00517.35
8.0.240.0000.00717.31
8.0.230.0000.00717.30
8.0.220.0080.00017.30
8.0.210.0000.00717.34
8.0.200.0000.00717.32
8.0.190.0050.00317.40
8.0.180.0040.00417.37
8.0.170.0040.00417.32
8.0.160.0070.00417.35
8.0.150.0000.01117.25
8.0.140.0000.01117.29
8.0.130.0000.00613.71
8.0.120.0040.00417.20
8.0.110.0000.00817.25
8.0.100.0030.00517.32
8.0.90.0040.00417.21
8.0.80.0110.00817.37
8.0.70.0080.00017.37
8.0.60.0030.00517.14
8.0.50.0040.00417.09
8.0.30.0090.00917.53
8.0.20.0100.00717.65
8.0.10.0120.00917.40
8.0.00.0110.00817.43
7.4.330.0030.00317.24
7.4.320.0000.00716.84
7.4.300.0040.00416.98
7.4.290.0000.00716.95
7.4.280.0040.00416.74
7.4.270.0030.00317.04
7.4.260.0000.00513.60
7.4.250.0050.00317.03
7.4.240.0000.00716.89
7.4.230.0030.00316.71
7.4.220.0040.00416.96
7.4.210.0090.00716.93
7.4.200.0030.00316.66
7.4.150.0080.01217.40
7.4.140.0140.00817.40
7.4.130.0110.01017.40
7.4.120.0160.00817.40
7.4.110.0070.01117.40
7.4.100.0140.00317.40
7.4.90.0080.01117.40
7.4.80.0070.01017.40
7.4.70.0160.01317.40
7.4.60.0130.00617.40
7.4.50.0070.01117.40
7.4.40.0040.01417.40
7.4.30.0100.00917.40
7.4.20.0110.00717.40
7.4.10.0110.00817.40
7.4.00.0080.00817.40
7.3.330.0040.00416.65
7.3.320.0000.00613.46
7.3.310.0050.00216.76
7.3.300.0030.00316.66
7.3.290.0060.00916.74
7.3.270.0060.01117.40
7.3.260.0180.00017.40
7.3.250.0150.00517.40
7.3.240.0100.01017.40
7.3.230.0170.00717.40
7.3.220.0200.00317.40
7.3.210.0030.01417.40
7.3.200.0130.00517.40
7.3.190.0170.00917.40
7.3.180.0190.00017.40
7.3.170.0100.01017.40
7.3.160.0170.00317.40
7.3.150.0080.01117.40
7.3.140.0100.00917.40
7.3.130.0110.00717.40
7.3.120.0130.00617.40
7.3.110.0170.00317.40
7.3.100.0130.00717.40
7.3.90.0040.01517.40
7.3.80.0120.00717.40
7.3.70.0180.00317.40
7.3.60.0040.01617.40
7.3.50.0040.01517.40
7.3.40.0060.01217.40
7.3.30.0180.00317.40
7.3.20.0120.00817.40
7.3.10.0100.01117.40
7.3.00.0100.01017.40

preferences:
173.36 ms | 403 KiB | 5 Q