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.5.10.0040.00617.03
8.5.00.0120.01122.26
8.4.150.0020.00114.05
8.4.140.0180.00318.02
8.4.130.0050.00418.12
8.4.120.0130.00622.59
8.4.110.0090.01222.98
8.4.100.0110.01018.43
8.4.90.0130.00718.35
8.4.80.0100.01018.17
8.4.70.0120.00918.14
8.4.60.0100.01019.10
8.4.50.0060.00319.92
8.4.40.0060.00620.07
8.4.30.0140.00720.96
8.4.20.0060.00318.15
8.4.10.0030.00626.37
8.3.280.0100.01020.55
8.3.270.0090.01017.14
8.3.260.0130.00816.65
8.3.250.0120.00719.35
8.3.240.0110.01017.07
8.3.230.0190.00718.25
8.3.220.0110.00517.34
8.3.210.0080.00917.16
8.3.200.0050.00417.04
8.3.190.0060.01018.57
8.3.180.0030.00517.25
8.3.170.0130.00617.07
8.3.160.0110.00016.64
8.3.150.0080.01217.54
8.3.140.0090.00919.34
8.3.130.0030.00616.87
8.3.120.0240.00718.04
8.3.110.0130.00718.91
8.3.100.0180.00420.35
8.3.90.0160.00621.89
8.3.80.0120.00517.07
8.3.70.0240.00317.81
8.3.60.0130.00817.92
8.3.50.0110.00921.56
8.3.40.0090.00918.54
8.3.30.0130.00918.42
8.3.20.0100.00720.88
8.3.10.0140.00421.29
8.3.00.0080.00222.08
8.2.290.0120.00620.85
8.2.280.0050.00519.04
8.2.270.0070.01317.26
8.2.260.0090.00917.45
8.2.250.0100.01016.96
8.2.240.0140.00717.31
8.2.230.0090.00719.79
8.2.220.0060.01027.28
8.2.210.0090.00521.75
8.2.200.0110.00616.86
8.2.190.0170.00517.85
8.2.180.0160.00521.37
8.2.170.0220.00018.69
8.2.160.0120.00520.45
8.2.150.0120.00321.77
8.2.140.0130.00221.29
8.2.130.0080.00722.03
8.2.120.0090.00722.28
8.2.110.0120.00420.27
8.2.100.0190.00018.02
8.2.90.0090.00518.13
8.2.80.0090.00718.79
8.2.70.0100.00418.04
8.2.60.0120.00318.13
8.2.50.0120.00517.83
8.2.40.0090.00320.09
8.2.30.0100.00519.40
8.2.20.0100.00519.08
8.2.10.0100.00619.41
8.2.00.0100.00518.86
8.1.330.0110.00917.13
8.1.320.0070.01216.77
8.1.310.0060.00317.37
8.1.300.0170.00317.71
8.1.290.0080.00817.68
8.1.280.0130.00921.07
8.1.270.0120.00520.07
8.1.260.0060.01022.94
8.1.250.0110.00522.83
8.1.240.0100.00420.96
8.1.230.0090.00720.18
8.1.220.0110.00417.81
8.1.210.0070.00818.35
8.1.200.0100.00417.57
8.1.190.0080.00617.63
8.1.180.0070.00717.86
8.1.170.0150.00418.17
8.1.160.0110.00418.50
8.1.150.0110.00418.50
8.1.140.0110.00418.53
8.1.130.0150.00218.56
8.1.120.0110.00318.34
8.1.110.0110.00418.34
8.1.100.0100.00618.75
8.1.90.0090.00618.32
8.1.80.0120.00418.31
8.1.70.0110.00418.29
8.1.60.0120.00518.43
8.1.50.0140.00318.38
8.1.40.0100.00718.39
8.1.30.0160.00218.57
8.1.20.0140.00418.42
8.1.10.0090.00818.35
8.1.00.0140.00318.38
8.0.300.0110.00319.77
8.0.290.0100.00317.03
8.0.280.0080.00718.07
8.0.270.0080.00617.42
8.0.260.0130.00118.03
8.0.250.0100.00417.75
8.0.240.0170.00217.78
8.0.230.0140.00417.87
8.0.220.0150.00417.72
8.0.210.0130.00617.79
8.0.200.0130.00617.82
8.0.190.0130.00617.75
8.0.180.0180.00317.79
8.0.170.0180.00317.81
8.0.160.0140.00517.77
8.0.150.0130.00717.73
8.0.140.0140.00617.60
8.0.130.0140.00316.88
8.0.120.0130.00617.73
8.0.110.0140.00417.73
8.0.100.0150.00517.71
8.0.90.0150.00417.63
8.0.80.0140.00617.59
8.0.70.0160.00418.06
8.0.60.0150.00517.66
8.0.50.0120.00717.69
8.0.30.0170.00417.73
8.0.20.0120.00917.74
8.0.10.0150.00617.83
8.0.00.0140.00718.16
7.4.330.0110.00516.27
7.4.320.0130.00517.34
7.4.300.0100.00717.39
7.4.290.0150.00417.31
7.4.280.0120.00917.35
7.4.270.0120.00717.31
7.4.260.0140.00416.52
7.4.250.0110.00617.35
7.4.240.0140.00417.29
7.4.230.0130.00517.29
7.4.220.0080.00617.22
7.4.210.0090.01017.26
7.4.200.0100.00717.26
7.4.190.0180.00317.64
7.4.180.0170.00517.51
7.4.160.0140.00717.54
7.4.150.0120.00817.42
7.4.140.0130.00717.48
7.4.130.0160.00417.43
7.4.120.0100.00817.37
7.4.110.0110.00717.75
7.4.100.0130.00617.46
7.4.90.0110.00617.73
7.4.80.0130.00717.36
7.4.70.0190.00817.39
7.4.60.0140.00317.42
7.4.50.0140.00317.31
7.4.40.0120.00317.38
7.4.30.0130.00617.42
7.4.20.0100.00617.36
7.4.10.0130.00517.29
7.4.00.0110.00517.37
7.3.330.0080.00617.18
7.3.320.0110.00316.40
7.3.310.0100.00317.15
7.3.300.0100.00417.22
7.3.290.0120.00716.93
7.3.280.0160.00517.34
7.3.270.0100.01017.35
7.3.260.0160.00417.34
7.3.250.0160.00517.40
7.3.240.0110.00717.35
7.3.230.0120.00817.34
7.3.220.0150.00617.34
7.3.210.0160.00417.31
7.3.200.0160.00717.32
7.3.190.0140.00917.56
7.3.180.0150.00617.36
7.3.170.0170.00517.29
7.3.160.0130.00917.30
7.3.150.0130.00817.63
7.3.140.0150.00617.67
7.3.130.0180.00217.30
7.3.120.0130.00717.64
7.3.110.0130.00717.27
7.3.100.0120.00817.30
7.3.90.0110.00917.57
7.3.80.0130.00617.34
7.3.70.0150.00517.34
7.3.60.0140.00717.39
7.3.50.0140.00717.70
7.3.40.0140.00717.39
7.3.30.0110.00917.43
7.3.20.0140.00718.40
7.3.10.0160.00518.43
7.3.00.0140.00718.37

preferences:
36.24 ms | 403 KiB | 5 Q