3v4l.org

run code in 300+ PHP versions simultaneously
<?php $data = '<user><prop name="A"><sub name="X"></sub></prop><prop name="B"><sub name="Y"></sub></prop></user>'; $xml = new DomDocument; $xml->loadXML($data); $xpath = new DomXpath($xml); $subY = $xpath->query('//sub[@name="Y"]')->item(0); $design = $xml->createElement('design'); $design->setAttribute('name', 'J'); $design->setAttribute('path', 'folder'); $subY->appendChild($design); $xml->formatOutput = true; $xml->preserveWhiteSpace = false; echo $xml->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.60.0170.00318.68
8.3.50.0100.00822.17
8.3.40.0140.00419.29
8.3.30.0160.00019.09
8.3.20.0080.00019.14
8.3.10.0030.00521.46
8.3.00.0040.00424.03
8.2.180.0040.01117.13
8.2.170.0070.00722.96
8.2.160.0060.00920.95
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0080.00021.38
8.2.110.0070.00422.70
8.2.100.0030.00918.16
8.2.90.0000.00819.68
8.2.80.0030.00619.79
8.2.70.0030.00517.88
8.2.60.0040.00418.41
8.2.50.0000.00818.07
8.2.40.0080.00018.55
8.2.30.0040.00419.87
8.2.20.0000.00718.13
8.2.10.0080.00018.14
8.2.00.0100.00018.10
8.1.280.0070.00725.92
8.1.270.0040.00420.73
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0060.00322.68
8.1.230.0080.00321.34
8.1.220.0030.00518.77
8.1.210.0090.00019.22
8.1.200.0100.00317.60
8.1.190.0040.00417.91
8.1.180.0080.00018.10
8.1.170.0050.00318.88
8.1.160.0040.00419.14
8.1.150.0040.00418.91
8.1.140.0080.00017.80
8.1.130.0000.00718.16
8.1.120.0000.00717.66
8.1.110.0050.00317.78
8.1.100.0030.00617.88
8.1.90.0040.00417.64
8.1.80.0000.00717.86
8.1.70.0030.00517.62
8.1.60.0080.00018.02
8.1.50.0000.00717.65
8.1.40.0070.00317.74
8.1.30.0060.00317.99
8.1.20.0040.00418.06
8.1.10.0040.00417.84
8.1.00.0030.00618.00
8.0.300.0060.00320.26
8.0.290.0040.00417.55
8.0.280.0030.00318.76
8.0.270.0040.00418.32
8.0.260.0030.00317.19
8.0.250.0050.00317.25
8.0.240.0080.00017.26
8.0.230.0000.00717.17
8.0.220.0000.00717.27
8.0.210.0000.00717.08
8.0.200.0030.00317.25
8.0.190.0040.00417.21
8.0.180.0040.00417.29
8.0.170.0000.00717.33
8.0.160.0040.00417.32
8.0.150.0070.00017.15
8.0.140.0040.00417.02
8.0.130.0050.00013.63
8.0.120.0060.00317.10
8.0.110.0030.00617.05
8.0.100.0000.00717.19
8.0.90.0040.00417.35
8.0.80.0030.01217.26
8.0.70.0030.00517.19
8.0.60.0000.00717.17
8.0.50.0040.00417.25
8.0.30.0140.00617.41
8.0.20.0080.01117.47
8.0.10.0000.00817.30
8.0.00.0140.00917.00
7.4.330.0000.00517.17
7.4.320.0060.00016.75
7.4.300.0000.00616.77
7.4.290.0080.00016.84
7.4.280.0030.00316.85
7.4.270.0000.00816.89
7.4.260.0000.00713.68
7.4.250.0000.00816.83
7.4.240.0030.00316.82
7.4.230.0000.00716.78
7.4.220.0160.00616.79
7.4.210.0060.00916.84
7.4.200.0030.00316.96
7.4.190.0080.00016.96
7.4.160.0040.01216.88
7.4.150.0200.01717.40
7.4.140.0120.00617.86
7.4.130.0110.00816.93
7.4.120.0080.01116.96
7.4.110.0070.01016.98
7.4.100.0090.01216.85
7.4.90.0060.01216.89
7.4.80.0040.01419.39
7.4.70.0130.00316.77
7.4.60.0140.00716.84
7.4.50.0030.00616.70
7.4.40.0120.00322.77
7.4.30.0140.00316.80
7.4.00.0090.00615.20
7.3.330.0030.00313.55
7.3.320.0000.00613.41
7.3.310.0000.00716.72
7.3.300.0030.00316.61
7.3.290.0060.00816.55
7.3.280.0100.00716.58
7.3.270.0090.00917.40
7.3.260.0090.00818.24
7.3.250.0090.01116.58
7.3.240.0060.01116.78
7.3.230.0120.00616.57
7.3.210.0060.01116.73
7.3.200.0130.00619.39
7.3.190.0140.00316.75
7.3.180.0140.00716.64
7.3.170.0060.00916.76
7.3.160.0060.00916.77
7.3.120.0090.00315.03
7.2.330.0140.00316.89
7.2.320.0160.00417.14
7.2.310.0120.00616.70
7.2.300.0100.00717.18
7.2.290.0060.01216.80
7.2.60.0060.01616.41
7.1.200.0000.01115.84
7.1.70.0030.00617.32
7.1.60.0040.00717.30
7.1.50.0070.01316.83
7.1.00.0070.03022.63
7.0.200.0000.01616.90
7.0.140.0100.06722.13
7.0.60.0130.07320.12
7.0.50.0100.05318.06
7.0.40.0100.03720.23
7.0.30.0130.04720.40
7.0.20.0300.07020.23
7.0.10.0170.07720.41
7.0.00.0000.05020.35
5.6.280.0030.07320.95
5.6.210.0070.08020.79
5.6.200.0000.07018.32
5.6.190.0100.04320.77
5.6.180.0530.07020.66
5.6.170.0200.03720.72
5.6.160.0000.04720.63
5.6.150.0100.03318.36
5.6.140.0070.03718.26
5.6.130.0100.05318.31
5.6.120.0030.06321.27
5.6.110.0000.08721.16
5.6.100.0070.08321.23
5.6.90.0030.04021.29
5.6.80.0130.07320.67
5.5.350.0270.06720.50
5.5.340.0070.08718.18
5.5.330.0100.07720.62
5.5.320.0400.03720.39
5.5.310.0330.07720.61
5.5.300.0030.03718.11
5.5.290.0200.07318.21
5.5.280.0100.07721.02
5.5.270.0070.05720.97
5.5.260.0170.07021.01
5.5.250.0030.09020.80
5.5.240.0070.07720.31
5.4.450.0270.08319.55
5.4.440.0270.04719.63
5.4.430.0230.04719.40
5.4.420.0300.07019.61
5.4.410.0230.05019.57
5.4.400.0330.05319.25
5.4.390.0270.04319.37
5.4.380.0230.06019.29
5.4.370.0300.04019.09
5.4.360.0200.05019.31
5.4.350.0400.05719.25
5.4.340.0300.05319.23
5.4.320.0270.07319.34
5.4.310.0270.06019.31
5.4.300.0330.04719.37
5.4.290.0230.04719.08
5.4.280.0270.04019.21
5.4.270.0400.05719.23
5.4.260.0270.04319.45
5.4.250.0370.06319.20
5.4.240.0270.06019.05
5.4.230.0370.07019.28
5.4.220.0370.06019.20
5.4.210.0330.05019.29
5.4.200.0370.06319.18
5.4.190.0300.07319.39
5.4.180.0300.04719.20
5.4.170.0300.05719.36
5.4.160.0270.03719.05
5.4.150.0300.07719.29
5.4.140.0270.04316.60
5.4.130.0430.06016.65
5.4.120.0200.04016.49
5.4.110.0400.06016.66
5.4.100.0400.05716.66
5.4.90.0400.05716.51
5.4.80.0370.07016.49
5.4.70.0330.04716.69
5.4.60.0430.05716.58
5.4.50.0430.03316.60
5.4.40.0370.06316.69
5.4.30.0270.07316.62
5.4.20.0330.06716.36
5.4.10.0330.05016.44
5.4.00.0330.04716.06
5.3.290.0230.08314.90
5.3.280.0330.05314.62
5.3.270.0300.05314.66
5.3.260.0370.06714.66
5.3.250.0330.04014.68
5.3.240.0370.04014.82
5.3.230.0270.05314.63
5.3.220.0400.06314.63
5.3.210.0270.07714.73
5.3.200.0330.06714.64
5.3.190.0270.07714.66
5.3.180.0370.06014.61
5.3.170.0300.06714.66
5.3.160.0300.06714.63
5.3.150.0270.07714.63
5.3.140.0300.07014.61
5.3.130.0370.04014.66
5.3.120.0300.04314.59
5.3.110.0300.05714.61
5.3.100.0300.04014.09
5.3.90.0270.07714.07
5.3.80.0300.06014.08
5.3.70.0230.04314.21
5.3.60.0330.06314.21
5.3.50.0400.05714.19
5.3.40.0300.04014.15
5.3.30.0270.04314.15
5.3.20.0300.04313.71
5.3.10.0270.07313.82
5.3.00.0330.06313.71
5.2.170.0270.05311.24
5.2.160.0230.04311.30
5.2.150.0300.02011.35
5.2.140.0230.05311.34
5.2.130.0400.04711.27
5.2.120.0200.03711.42
5.2.110.0230.03311.16
5.2.100.0200.05311.31
5.2.90.0270.05711.31
5.2.80.0200.04011.25
5.2.70.0170.03711.14
5.2.60.0200.04711.35
5.2.50.0270.05711.21
5.2.40.0130.04011.16
5.2.30.0170.03711.13
5.2.20.0230.05711.06
5.2.10.0300.02310.97
5.2.00.0200.06010.83
5.1.60.0200.03010.80
5.1.50.0230.03310.80
5.1.40.0200.05010.80
5.1.30.0170.05010.80
5.1.20.0230.04710.80
5.1.10.0300.04710.80
5.1.00.0200.05310.80
5.0.50.0130.03010.80
5.0.40.0100.03710.80
5.0.30.0170.05710.80
5.0.20.0130.04010.80
5.0.10.0130.02710.80
5.0.00.0100.03710.80
4.4.90.0070.01710.80
4.4.80.0130.01310.80
4.4.70.0130.03010.80
4.4.60.0100.03310.80
4.4.50.0070.02010.80
4.4.40.0130.04710.80
4.4.30.0200.02310.80
4.4.20.0070.04010.80
4.4.10.0070.03010.80
4.4.00.0070.04010.80
4.3.110.0130.03010.80
4.3.100.0130.02710.80
4.3.90.0100.02010.80
4.3.80.0170.04310.80
4.3.70.0100.01710.80
4.3.60.0100.03310.80
4.3.50.0100.02710.80
4.3.40.0100.04710.80
4.3.30.0070.03710.80
4.3.20.0070.03710.80
4.3.10.0070.03310.80
4.3.00.0070.03010.80

preferences:
36.65 ms | 400 KiB | 5 Q