3v4l.org

run code in 300+ PHP versions simultaneously
<?php $content = <<<XML <?xml version="1.0" encoding="ISO-8859-1"?> <PersonList> <Header> </Header> <Person> <Name>Sonu Kapoor</Name> <Age>24</Age> <Gender>M</Gender> <PostalCode>54879</PostalCode> </Person> <Person> <Name>Jasmin</Name> <Age>28</Age> <Gender>M</Gender> <PostalCode>78745</PostalCode> </Person> <Person> <Name>Josef</Name> <Age>232</Age> <Gender>F</Gender> <PostalCode>53454</PostalCode> </Person> </PersonList> XML; $doc = new DOMDocument(); $doc->loadXML($content); $xp = new DOMXPath($doc); $nodeList = $xp->query('/PersonList/Header/Person[./Name="Jasmin"]/*'); for($i = 0; $i < $nodeList->length; $i++) { $nodeName = $nodeList->item($i)->nodeName; switch ($nodeName) { case 'Age': $nodeList->item($i)->nodeValue = 33; break; case 'Gender': $nodeList->item($i)->nodeValue = 'F'; break; } } $doc->formatOutput = true; echo $doc->saveXML();

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.40.0150.00019.33
8.3.30.0030.01319.54
8.3.20.0120.00620.59
8.3.10.0050.00322.46
8.3.00.0000.00822.66
8.2.170.0110.00722.96
8.2.160.0040.01119.55
8.2.150.0030.00524.18
8.2.140.0040.00424.66
8.2.130.0030.01726.16
8.2.120.0040.00419.91
8.2.110.0030.00622.55
8.2.100.0000.01119.71
8.2.90.0080.00019.60
8.2.80.0000.00818.43
8.2.70.0040.00417.88
8.2.60.0040.00418.41
8.2.50.0060.00318.07
8.2.40.0080.00018.53
8.2.30.0000.00918.45
8.2.20.0030.00617.99
8.2.10.0030.00617.95
8.2.00.0040.00417.92
8.1.270.0030.00619.05
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00324.17
8.1.230.0110.00019.50
8.1.220.0040.00418.03
8.1.210.0000.00818.77
8.1.200.0060.00317.49
8.1.190.0060.00317.90
8.1.180.0000.00719.07
8.1.170.0000.00818.96
8.1.160.0040.00422.45
8.1.150.0070.00019.02
8.1.140.0000.00717.65
8.1.130.0030.00718.25
8.1.120.0040.00417.76
8.1.110.0000.00717.70
8.1.100.0050.00317.87
8.1.90.0000.00717.64
8.1.80.0050.00217.79
8.1.70.0040.00417.66
8.1.60.0060.00617.83
8.1.50.0000.00817.93
8.1.40.0000.00817.66
8.1.30.0000.00817.84
8.1.20.0040.00417.91
8.1.10.0080.00017.84
8.1.00.0040.00417.72
8.0.300.0040.00418.77
8.0.290.0040.00417.42
8.0.280.0040.00418.86
8.0.270.0050.00217.58
8.0.260.0070.00017.28
8.0.250.0070.00017.25
8.0.240.0040.00417.49
8.0.230.0070.00017.25
8.0.220.0000.00717.28
8.0.210.0000.00717.34
8.0.200.0070.00017.36
8.0.190.0040.00417.43
8.0.180.0040.00417.20
8.0.170.0080.00017.33
8.0.160.0000.00717.37
8.0.150.0070.00017.14
8.0.140.0070.00017.23
8.0.130.0030.00313.80
8.0.120.0000.00817.05
8.0.110.0000.00717.38
8.0.100.0000.00817.37
8.0.90.0040.00417.24
8.0.80.0090.00617.25
8.0.70.0040.00417.11
8.0.60.0070.00017.14
8.0.50.0040.00617.17
8.0.30.0090.01217.44
8.0.20.0100.01017.54
8.0.10.0040.00417.26
8.0.00.0090.01117.28
7.4.330.0000.00615.00
7.4.320.0060.00016.80
7.4.300.0000.00616.89
7.4.290.0030.00516.98
7.4.280.0030.00316.93
7.4.270.0000.00716.70
7.4.260.0030.00316.78
7.4.250.0000.00716.88
7.4.240.0000.00816.96
7.4.230.0000.00716.82
7.4.220.0130.00616.90
7.4.210.0050.01016.96
7.4.200.0000.00717.06
7.4.190.0000.00716.88
7.4.160.0100.00716.69
7.4.150.0110.01117.40
7.4.140.0150.00617.86
7.4.130.0090.00816.90
7.4.120.0080.00916.84
7.4.110.0030.01316.91
7.4.100.0100.01316.84
7.4.90.0070.01016.88
7.4.80.0100.00719.39
7.4.70.0180.00316.87
7.4.60.0040.01316.74
7.4.50.0040.00416.87
7.4.40.0130.00722.77
7.4.30.0100.01016.82
7.4.00.0070.01115.05
7.3.330.0000.00513.37
7.3.320.0050.00013.62
7.3.310.0000.00716.82
7.3.300.0040.00416.64
7.3.290.0100.00416.65
7.3.280.0030.01216.69
7.3.270.0150.00917.40
7.3.260.0160.00316.68
7.3.250.0070.01016.92
7.3.240.0070.01116.87
7.3.230.0030.01716.75
7.3.210.0090.01616.96
7.3.200.0070.01119.39
7.3.190.0090.01316.76
7.3.180.0100.00716.70
7.3.170.0080.00816.70
7.3.160.0110.00616.80
7.3.120.0070.01015.00
7.3.110.0080.00815.02
7.3.100.0060.00814.89
7.3.90.0020.01115.05
7.3.80.0070.00815.10
7.3.70.0070.00514.88
7.3.60.0050.01214.89
7.3.50.0060.00614.93
7.3.40.0050.00814.96
7.3.30.0050.01014.91
7.3.20.0080.00616.69
7.3.10.0080.00816.86
7.3.00.0070.00516.90
7.2.330.0120.00617.18
7.2.320.0060.01417.20
7.2.310.0100.00717.00
7.2.300.0090.00917.27
7.2.290.0130.00616.94
7.2.250.0030.01515.28
7.2.240.0080.01215.41
7.2.230.0050.00715.13
7.2.220.0040.01215.16
7.2.210.0060.01015.05
7.2.200.0070.00815.23
7.2.190.0030.01115.20
7.2.180.0040.01015.34
7.2.170.0070.00515.33
7.2.00.0030.01319.29
7.1.330.0050.01015.88
7.1.320.0050.00415.92
7.1.310.0050.01016.04
7.1.300.0050.00715.94
7.1.290.0020.01315.86
7.1.280.0090.00616.07
7.1.270.0050.00815.92
7.1.260.0090.00716.03
7.1.100.0000.01118.39
7.1.70.0030.00617.43
7.1.60.0140.01119.82
7.1.50.0100.01417.08
7.1.00.0070.03022.63
7.0.200.0030.00316.77
7.0.140.0130.06722.22
7.0.60.0130.05720.25
7.0.50.0130.07718.12
7.0.40.0070.07720.19
7.0.30.0670.07020.30
7.0.20.0170.04020.21
7.0.10.0030.04320.23
7.0.00.0070.08320.37
5.6.210.0070.07320.72
5.6.200.0000.04318.40
5.6.190.0100.08020.50
5.6.180.0400.05720.86
5.6.170.0470.07020.59
5.6.160.0070.08720.63
5.6.150.0130.08018.34
5.6.140.0100.03718.35
5.6.130.0130.06318.39
5.6.120.0170.07321.15
5.6.110.0100.08321.23
5.6.100.0100.07721.16
5.6.90.0070.07321.13
5.6.80.0030.04020.52
5.5.350.0270.07720.54
5.5.340.0000.04318.14
5.5.330.0030.04720.59
5.5.320.0230.04720.39
5.5.310.0200.03720.50
5.5.300.0100.04318.14
5.5.290.0100.07018.16
5.5.280.0100.04320.95
5.5.270.0030.08020.98
5.5.260.0100.08320.92
5.5.250.0130.07320.91
5.5.240.0130.04020.45
5.4.450.0370.04019.68
5.4.440.1370.03719.79
5.4.430.0630.04019.71
5.4.420.1270.04319.54
5.4.410.0700.05319.57
5.4.400.0600.04019.47
5.4.390.0270.03719.36
5.4.380.0370.05318.66
5.4.370.0530.05718.87
5.4.360.0500.04718.79
5.4.350.0330.06318.89
5.4.340.0430.04318.86
5.4.320.0070.04112.76
5.4.310.0060.04012.76
5.4.300.0070.03512.76
5.4.290.0060.04112.76
5.4.280.0070.03312.66
5.4.270.0040.03712.66
5.4.260.0090.03412.66
5.4.250.0070.05319.03
5.4.240.0230.04019.06
5.4.230.0170.04719.21
5.4.220.0130.06318.98
5.4.210.0130.06319.17
5.4.200.0030.05719.02
5.4.190.0070.05319.01
5.4.180.0130.06718.98
5.4.170.0030.05718.95
5.4.160.0100.05019.11
5.4.150.0000.06318.82
5.4.140.0130.04716.45
5.4.130.0070.05316.72
5.4.120.0030.07716.61
5.4.110.0100.07316.73
5.4.100.0170.04016.54
5.4.90.0130.04316.54
5.4.80.0100.04716.73
5.4.70.0100.04716.62
5.4.60.0100.04716.33
5.4.50.0100.07016.61
5.4.40.0200.05316.41
5.4.30.0170.04016.74
5.4.20.0130.04016.46
5.4.10.0070.07316.46
5.4.00.0100.04316.11
5.3.290.0060.03913.02
5.3.280.0170.05014.65
5.3.270.0070.05314.73
5.3.260.0070.05314.82
5.3.250.0030.05314.91
5.3.240.0200.04014.68
5.3.230.0100.06314.77
5.3.220.0030.05314.66
5.3.210.0000.06014.88
5.3.200.0230.05314.63
5.3.190.0200.05014.63
5.3.180.0030.05314.81
5.3.170.0030.05314.70
5.3.160.0000.08014.66
5.3.150.0170.04314.74
5.3.140.0130.04714.76
5.3.130.0100.06314.68
5.3.120.0170.04314.65
5.3.110.0070.05714.65
5.3.100.0100.05714.14
5.3.90.0130.05014.07
5.3.80.0070.07014.21
5.3.70.0100.04314.17
5.3.60.0100.07014.17
5.3.50.0170.05714.15
5.3.40.0170.04014.08
5.3.30.0000.06314.00
5.3.20.0030.05713.79
5.3.10.0030.05013.79
5.3.00.0070.04713.84
5.2.170.0070.04711.45
5.2.160.0030.05311.34
5.2.150.0100.05711.24
5.2.140.0030.04311.39
5.2.130.0000.04311.37
5.2.120.0170.02711.27
5.2.110.0000.05011.25
5.2.100.0030.04311.27
5.2.90.0030.04011.40
5.2.80.0030.04311.18
5.2.70.0100.05711.29
5.2.60.0100.03711.20
5.2.50.0000.04711.11
5.2.40.0130.03011.16
5.2.30.0030.04311.04
5.2.20.0070.04011.02
5.2.10.0070.04011.03
5.2.00.0100.03311.07
5.1.60.0030.03710.25
5.1.50.0030.03710.14
5.1.40.0030.03710.09
5.1.30.0100.03310.55
5.1.20.0030.03710.41
5.1.10.0030.03310.27
5.1.00.0100.04710.43
5.0.50.0000.0438.68
5.0.40.0030.0278.63
5.0.30.0070.0438.41
5.0.20.0030.0278.51
5.0.10.0030.0378.32
5.0.00.0000.0508.32
4.4.90.0100.0137.36
4.4.80.0000.0277.36
4.4.70.0070.0237.36
4.4.60.0030.0277.36
4.4.50.0030.0207.36
4.4.40.0030.0377.36
4.4.30.0070.0207.36
4.4.20.0170.0177.36
4.4.10.0070.0237.36
4.4.00.0030.0407.36
4.3.110.0130.0177.36
4.3.100.0000.0277.36
4.3.90.0000.0237.36
4.3.80.0070.0307.36
4.3.70.0130.0177.36
4.3.60.0100.0177.36
4.3.50.0030.0277.36
4.3.40.0200.0277.36
4.3.30.0070.0207.36
4.3.20.0030.0207.36
4.3.10.0000.0237.36
4.3.00.0100.01314.52

preferences:
45.26 ms | 400 KiB | 5 Q