3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); $buffer=<<<XML <description><![CDATA[<div id="2" style="all: inherit;"><span style='font-size: 40px'>Testing123</span></div>]]></description> XML; $asString = static function (SimpleXMLElement $el) { return rtrim(explode("\n", $el->asXML(), 2)[1]); }; $makeCdata = static function (SimpleXMLElement $el, string $data) { $el[0] = null; if ($n = dom_import_simplexml($el)) { $cd = $n->ownerDocument->createCDATASection($data); $n->appendChild($cd); } }; $xml = simplexml_load_string($buffer); $cdata = simplexml_load_string((string)$xml); foreach ($cdata->xpath('@*[name(.) != "id"]|*/@*') as $attribute) unset($attribute[0]) ; $makeCdata($xml, $asString($cdata)); echo $xml->asXML();

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.4.130.0120.00918.21
8.4.120.0140.00720.70
8.4.110.0100.01022.70
8.4.100.0110.01018.04
8.4.90.0080.00220.99
8.4.80.0070.00118.97
8.4.70.0110.01018.53
8.4.60.0110.00719.24
8.4.50.0100.01019.29
8.4.40.0120.00919.95
8.4.30.0170.00718.93
8.4.20.0140.00719.37
8.4.10.0190.00019.89
8.3.260.0170.00516.90
8.3.250.0130.00519.17
8.3.240.0130.00617.52
8.3.230.0100.00917.07
8.3.220.0100.00919.50
8.3.210.0060.00217.11
8.3.200.0060.00317.04
8.3.190.0130.00617.71
8.3.180.0120.00717.52
8.3.170.0070.01121.21
8.3.160.0090.00917.65
8.3.150.0100.01019.51
8.3.140.0030.00617.35
8.3.130.0040.00418.85
8.3.120.0060.01321.04
8.3.110.0060.00320.94
8.3.100.0040.00424.06
8.3.90.0050.00326.77
8.3.80.0060.00319.36
8.3.70.0160.00019.06
8.3.60.0190.00018.64
8.3.50.0110.00418.42
8.3.40.0110.00719.21
8.3.30.0120.00319.29
8.3.20.0040.00424.18
8.3.10.0000.00824.66
8.3.00.0060.00326.16
8.2.290.0110.00921.05
8.2.280.0120.00718.92
8.2.270.0150.00317.38
8.2.260.0110.00419.26
8.2.250.0090.00017.20
8.2.240.0030.00617.50
8.2.230.0060.00322.58
8.2.220.0160.00337.54
8.2.210.0090.00626.77
8.2.200.0050.00518.88
8.2.190.0080.01218.67
8.2.180.0090.00625.92
8.2.170.0060.00919.41
8.2.160.0000.01422.96
8.2.150.0040.00425.66
8.2.140.0030.00524.66
8.2.130.0000.00726.16
8.2.120.0080.00026.16
8.2.110.0070.00321.67
8.2.100.0060.00618.28
8.2.90.0040.00419.68
8.2.80.0000.00818.00
8.2.70.0060.00318.00
8.2.60.0000.00818.30
8.2.50.0060.00318.07
8.2.40.0000.00818.66
8.2.30.0000.00818.68
8.2.20.0000.00818.62
8.2.10.0080.00019.66
8.2.00.0030.00619.82
8.1.330.0060.00422.39
8.1.320.0100.00816.75
8.1.310.0040.00417.16
8.1.300.0050.00518.76
8.1.290.0060.00330.84
8.1.280.0080.00625.92
8.1.270.0040.00423.99
8.1.260.0090.00026.35
8.1.250.0080.00028.09
8.1.240.0030.00623.15
8.1.230.0060.00618.33
8.1.220.0000.00918.29
8.1.210.0000.00818.77
8.1.200.0030.00617.85
8.1.190.0030.00517.85
8.1.180.0040.00418.10
8.1.170.0060.00319.09
8.1.160.0030.00619.38
8.1.150.0050.00219.33
8.1.140.0040.00419.23
8.1.130.0040.00417.92
8.1.120.0040.00417.93
8.1.110.0000.00817.76
8.1.100.0030.00617.84
8.1.90.0040.00417.93
8.1.80.0000.00717.70
8.1.70.0030.00317.95
8.1.60.0000.00917.95
8.1.50.0040.00417.84
8.1.40.0080.00017.97
8.1.30.0000.00818.11
8.1.20.0040.00417.99
8.1.10.0080.00017.87
8.1.00.0070.00317.89
8.0.300.0020.00518.77
8.0.290.0030.00517.25
8.0.280.0040.00418.92
8.0.270.0000.00718.45
8.0.260.0030.00317.23
8.0.250.0050.00217.53
8.0.240.0080.00017.48
8.0.230.0080.00017.31
8.0.220.0060.00317.37
8.0.210.0030.00317.27
8.0.200.0030.00317.48
8.0.190.0050.00317.27
8.0.180.0070.00017.34
8.0.170.0090.00017.20
8.0.160.0060.00317.26
8.0.150.0050.00217.33
8.0.140.0070.00317.36
8.0.130.0000.00613.87
8.0.120.0030.00517.20
8.0.110.0000.00817.46
8.0.100.0040.00417.46
8.0.90.0040.00417.43
8.0.80.0090.00617.29
8.0.70.0060.00917.40
8.0.60.0070.00717.24
8.0.50.0090.00617.19
8.0.30.0130.00717.43
8.0.20.0100.01017.57
8.0.10.0100.01017.63
8.0.00.0100.01017.46
7.4.330.0000.00515.55
7.4.320.0030.00317.05
7.4.300.0030.00316.98
7.4.290.0050.00316.86
7.4.280.0000.00816.98
7.4.270.0080.00017.06
7.4.260.0050.00013.72
7.4.250.0040.00416.99
7.4.240.0040.00416.95
7.4.230.0040.00416.75
7.4.220.0040.00417.00
7.4.210.0070.01016.94
7.4.200.0060.01216.98
7.4.190.0120.00617.10
7.4.180.0120.00917.11
7.4.160.0040.01217.11
7.4.150.0070.00716.91
7.4.140.0070.00716.80
7.4.130.0170.00316.96
7.4.120.0070.01316.93
7.4.110.0100.01016.88
7.4.100.0080.00616.98
7.4.90.0140.00016.88
7.4.80.0040.01116.86
7.4.70.0070.00716.96
7.4.60.0110.00417.01
7.4.50.0000.01416.91
7.4.40.0060.00916.84
7.4.30.0090.00616.84
7.4.20.0140.00016.91
7.4.10.0160.00317.03
7.4.00.0120.00316.94
7.3.330.0040.00416.92
7.3.320.0030.00313.81
7.3.310.0070.00016.90
7.3.300.0030.00316.88
7.3.290.0090.00816.78
7.3.280.0070.00716.82
7.3.270.0090.00616.82
7.3.260.0030.01016.94
7.3.250.0000.01316.86
7.3.240.0070.00716.82
7.3.230.0110.00416.88
7.3.220.0060.00716.77
7.3.210.0030.01316.75
7.3.200.0070.01316.81
7.3.190.0030.01016.80
7.3.180.0100.01016.87
7.3.170.0100.00416.70
7.3.160.0040.01016.78
7.3.150.0030.01116.83
7.3.140.0100.00316.75
7.3.130.0070.00716.75
7.3.120.0070.00716.75
7.3.110.0060.00916.77
7.3.100.0130.00016.74
7.3.90.0000.01316.98
7.3.80.0000.01416.80
7.3.70.0100.00316.80
7.3.60.0120.00316.99
7.3.50.0080.00616.83
7.3.40.0040.01516.87
7.3.30.0070.00716.91
7.3.20.0200.00717.00
7.3.10.0030.01516.77
7.3.00.0030.01516.84

preferences:
34.61 ms | 403 KiB | 5 Q