3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xmlns = 'urn:foo'; $dom = new DOMDocument(); /* On the root level the prefix is replaced by default and the namespace for the attribute is lost */ $root = $dom->createElementNS($xmlns, 'element'); $root->setAttributeNS($xmlns, 'foo:attribute', 'bar'); $dom->appendChild($root); /* On the second level the prefix is replaced, the namespace declaration is duplicated and the element gets a prefix that was never provided. */ $child = $dom->createElementNS($xmlns, 'element'); $child->setAttributeNS($xmlns, 'foo:attribute', 'bar'); $root->appendChild($child); /* On the third level the prefix is replaced and the element gets a prefix again. */ $subchild = $dom->createElementNS($xmlns, 'element'); $subchild->setAttributeNS($xmlns, 'foo:attribute', 'bar'); $child->appendChild($subchild); /* If you add the element node before setting the attribute it gets no prefix */ $child = $dom->createElementNS($xmlns, 'element'); $root->appendChild($child); $child->setAttributeNS($xmlns, 'foo:attribute', 'bar'); $dom->formatOutput = TRUE; echo $dom->saveXml(); /* Expected <?xml version="1.0"?> <element xmlns="urn:foo" xmlns:foo="urn:foo" foo:attribute="bar"> <element foo:attribute="bar"> <element foo:attribute="bar"/> </element> </element> */

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.0100.01018.30
8.3.50.0150.00822.04
8.3.40.0000.01418.99
8.3.30.0170.00319.52
8.3.20.0050.00320.44
8.3.10.0060.00322.16
8.3.00.0080.00022.65
8.2.180.0100.00717.00
8.2.170.0170.00322.96
8.2.160.0030.01020.65
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0000.00726.16
8.2.120.0050.00319.48
8.2.110.0090.00022.21
8.2.100.0060.00619.70
8.2.90.0040.00419.38
8.2.80.0050.00318.18
8.2.70.0000.00817.75
8.2.60.0060.00317.93
8.2.50.0060.00318.07
8.2.40.0050.00218.28
8.2.30.0080.00318.21
8.2.20.0040.00417.86
8.2.10.0080.00019.66
8.2.00.0050.00317.87
8.1.280.0100.01025.92
8.1.270.0040.00422.30
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00024.09
8.1.230.0040.00819.22
8.1.220.0040.00418.04
8.1.210.0080.00018.77
8.1.200.0030.00617.48
8.1.190.0080.00017.54
8.1.180.0030.00618.10
8.1.170.0080.00018.78
8.1.160.0030.00622.15
8.1.150.0080.00018.86
8.1.140.0060.00317.57
8.1.130.0040.00418.03
8.1.120.0040.00417.59
8.1.110.0040.00417.58
8.1.100.0030.00517.64
8.1.90.0060.00317.61
8.1.80.0000.00717.56
8.1.70.0000.00717.58
8.1.60.0060.00317.79
8.1.50.0020.00517.62
8.1.40.0030.00517.65
8.1.30.0000.00717.80
8.1.20.0050.00317.69
8.1.10.0000.00817.80
8.1.00.0040.00417.77
8.0.300.0000.00718.77
8.0.290.0000.00717.30
8.0.280.0000.00718.67
8.0.270.0030.00317.43
8.0.260.0030.00317.04
8.0.250.0070.00017.19
8.0.240.0070.00317.03
8.0.230.0000.00716.97
8.0.220.0040.00417.08
8.0.210.0030.00317.02
8.0.200.0000.00717.14
8.0.190.0000.00816.99
8.0.180.0000.00716.97
8.0.170.0030.00317.11
8.0.160.0040.00416.90
8.0.150.0000.00817.05
8.0.140.0040.00416.84
8.0.130.0000.00513.45
8.0.120.0000.00716.91
8.0.110.0030.00517.02
8.0.100.0050.00316.96
8.0.90.0000.00716.91
8.0.80.0060.01017.02
8.0.70.0000.00716.86
8.0.60.0000.00717.00
8.0.50.0070.00017.10
8.0.30.0120.00617.39
8.0.20.0170.00617.40
8.0.10.0040.00417.23
8.0.00.0120.01216.89
7.4.330.0030.00315.00
7.4.320.0060.00016.67
7.4.300.0030.00316.63
7.4.290.0070.00016.56
7.4.280.0040.00416.62
7.4.270.0030.00316.73
7.4.260.0080.00016.71
7.4.250.0040.00416.60
7.4.240.0020.00616.71
7.4.230.0000.00816.82
7.4.220.0100.00716.52
7.4.210.0030.01216.69
7.4.200.0040.00416.67
7.4.190.0000.00716.80
7.4.160.0030.01316.60
7.4.150.0070.01117.40
7.4.140.0120.01017.86
7.4.130.0080.01016.76
7.4.120.0080.01016.79
7.4.110.0100.01016.66
7.4.100.0120.00616.79
7.4.90.0070.01016.65
7.4.80.0040.01519.39
7.4.70.0090.00916.53
7.4.60.0060.00916.75
7.4.50.0030.00516.65
7.4.40.0080.00622.77
7.4.30.0060.01316.64
7.4.00.0060.00915.01
7.3.330.0060.00013.24
7.3.320.0030.00313.13
7.3.310.0000.00716.37
7.3.300.0000.00716.51
7.3.290.0040.01116.39
7.3.280.0110.00416.44
7.3.270.0060.01217.40
7.3.260.0080.00816.72
7.3.250.0140.00416.52
7.3.240.0030.01816.51
7.3.230.0070.01016.41
7.3.210.0110.00816.51
7.3.200.0120.00419.39
7.3.190.0100.01116.74
7.3.180.0070.01016.63
7.3.170.0040.01316.58
7.3.160.0100.00616.55
7.3.120.0110.00415.07
7.2.330.0130.00416.70
7.2.320.0120.00816.98
7.2.310.0070.01016.85
7.2.300.0170.00316.57
7.2.290.0100.00716.85
7.2.00.0040.01119.29
7.1.100.0080.00417.77
7.1.70.0000.00817.12
7.1.60.0170.00719.82
7.1.50.0070.01816.77
7.1.00.0030.07722.55
7.0.200.0070.00416.88
7.0.140.0030.07322.13
7.0.110.0030.05019.89
7.0.100.0100.06020.11
7.0.90.0270.05719.96
7.0.80.0070.07720.09
7.0.70.0200.04719.87
7.0.60.0130.05720.12
7.0.50.0100.04719.99
7.0.40.0070.04019.75
7.0.30.0070.06019.77
7.0.20.0000.07319.79
7.0.10.0100.07719.77
7.0.00.0030.06019.84
5.6.280.0100.06721.16
5.6.260.0100.04020.70
5.6.250.0100.04020.79
5.6.240.0100.07020.70
5.6.230.0070.04320.86
5.6.220.0030.05720.61
5.6.210.0130.07320.75
5.6.200.0000.04320.69
5.6.190.0070.07720.65
5.6.180.0130.07020.69
5.6.170.0170.06020.64
5.6.160.0100.07020.86
5.6.150.0070.07720.54
5.6.140.0070.07720.66
5.6.130.0070.04320.79
5.6.120.0070.05020.71
5.6.110.0100.08020.68
5.6.100.0070.04020.66
5.6.90.0130.08020.87
5.6.80.0100.07320.07
5.6.70.0100.07320.00
5.6.60.0030.08720.05
5.6.50.0130.06720.08
5.6.40.0230.05320.02
5.6.30.0000.05020.04
5.6.20.0030.07720.03
5.6.10.0070.07019.94
5.6.00.0100.07720.02
5.5.380.0070.05017.46
5.5.370.0030.04017.45
5.5.360.0100.07317.69
5.5.350.0070.03717.63
5.5.340.0030.04018.20
5.5.330.0030.04318.09
5.5.320.0030.06718.38
5.5.310.0070.03718.19
5.5.300.0100.03317.91
5.5.290.0030.04018.09
5.5.280.0030.08717.93
5.5.270.0000.04717.90
5.5.260.0130.07018.04
5.5.250.0130.07718.00
5.5.240.0070.07717.57
5.5.230.0000.06017.30
5.5.220.0100.07317.30
5.5.210.0130.06717.46
5.5.200.0130.07317.58
5.5.190.0200.05717.58
5.5.180.0130.07317.28
5.5.160.0100.07317.43
5.5.150.0070.07717.53
5.5.140.0030.07717.45
5.5.130.0170.07017.27
5.5.120.0000.06317.59
5.5.110.0070.04317.27
5.5.100.0100.06317.48
5.5.90.0100.07017.32
5.5.80.0030.08317.34
5.5.70.0170.06317.46
5.5.60.0070.07017.15
5.5.50.0030.07717.47
5.5.40.0000.07717.08
5.5.30.0070.03017.46
5.5.20.0030.08317.31
5.5.10.0030.07717.39
5.5.00.0070.05717.27
5.4.450.0100.03319.56
5.4.440.0070.05719.40
5.4.430.0030.08019.44
5.4.420.0130.05319.34
5.4.410.0070.08019.51
5.4.400.0070.04319.09
5.4.390.0070.04719.07
5.4.380.0070.07719.16
5.4.370.0000.07719.32
5.4.360.0000.08019.01
5.4.350.0070.07319.14
5.4.340.0130.07319.05
5.4.320.0200.05019.25
5.4.310.0070.04318.97
5.4.300.0030.08019.06
5.4.290.0000.08719.23
5.4.280.0130.04019.24
5.4.270.0000.04019.07
5.4.260.0030.07719.23
5.4.250.0100.03719.01
5.4.240.0030.04719.11
5.4.230.0070.08019.30
5.4.220.0030.03719.09
5.4.210.0070.07319.04
5.4.200.0030.07319.13
5.4.190.0000.07719.25
5.4.180.0070.07319.06
5.4.170.0070.07018.99
5.4.160.0070.07319.02
5.4.150.0070.04319.03
5.4.140.0030.05716.35
5.4.130.0070.03316.73
5.4.120.0070.04016.33
5.4.110.0000.04016.64
5.4.100.0000.04016.58
5.4.90.0030.03716.30
5.4.80.0000.03716.33
5.4.70.0030.03316.29
5.4.60.0070.06016.63
5.4.50.0000.04316.57
5.4.40.0100.03716.46
5.4.30.0000.03716.27
5.4.20.0100.07016.53
5.4.10.0000.04016.32
5.4.00.0070.06715.77
5.3.290.0100.06714.80
5.3.280.0070.07314.60
5.3.270.0030.08014.58
5.3.260.0100.07314.76
5.3.250.0030.03714.60
5.3.240.0030.06014.60
5.3.230.0030.06714.58
5.3.220.0030.07714.63
5.3.210.0000.05714.71
5.3.200.0030.04014.57
5.3.190.0030.04314.70
5.3.180.0000.04014.46
5.3.170.0030.03714.58
5.3.160.0000.04014.70
5.3.150.0030.03314.65
5.3.140.0030.03714.70
5.3.130.0070.03314.52
5.3.120.0030.04714.55
5.3.110.0070.03314.71
5.3.100.0030.03714.18
5.3.90.0030.03714.00
5.3.80.0000.04014.00
5.3.70.0030.05314.09
5.3.60.0030.03314.08
5.3.50.0030.03314.02
5.3.40.0030.03713.98
5.3.30.0070.03013.91
5.3.20.0100.06713.59
5.3.10.0070.04313.65
5.3.00.0030.04013.61
5.2.170.0100.04011.89
5.2.160.0070.06311.89
5.2.150.0030.06311.89
5.2.140.0000.03011.89
5.2.130.0100.02011.89
5.2.120.0170.04011.89
5.2.110.0030.03311.89
5.2.100.0070.03011.89
5.2.90.0000.02711.89
5.2.80.0070.03311.89
5.2.70.0070.04011.89
5.2.60.0070.03311.89
5.2.50.0030.04011.89
5.2.40.0000.02711.89
5.2.30.0030.04011.89
5.2.20.0070.04311.89
5.2.10.0030.03011.89
5.2.00.0000.04011.89
5.1.60.0000.02311.89
5.1.50.0030.02711.89
5.1.40.0000.02711.89
5.1.30.0070.02011.89
5.1.20.0030.02311.89
5.1.10.0000.03011.89
5.1.00.0000.02711.89
5.0.50.0000.02311.89
5.0.40.0030.02011.89
5.0.30.0000.03011.89
5.0.20.0000.02011.89
5.0.10.0000.02011.89
5.0.00.0030.02711.89
4.4.90.0030.01011.89
4.4.80.0030.02011.89
4.4.70.0000.02011.89
4.4.60.0030.01311.89
4.4.50.0030.01311.89
4.4.40.0000.03011.89
4.4.30.0030.01311.89
4.4.20.0000.01711.89
4.4.10.0030.01311.89
4.4.00.0000.02311.89
4.3.110.0030.01311.89
4.3.100.0000.01311.89
4.3.90.0030.01311.89
4.3.80.0000.02311.89
4.3.70.0000.01711.89
4.3.60.0000.01311.89
4.3.50.0000.02011.89
4.3.40.0000.02011.89
4.3.30.0100.00711.89
4.3.20.0000.01711.89
4.3.10.0000.01311.89
4.3.00.0000.02011.89

preferences:
36.58 ms | 401 KiB | 5 Q