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 */ $subchild = $dom->createElementNS($xmlns, 'element'); $child->appendChild($subchild); $subchild->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.0190.00018.45
8.3.50.0090.00722.11
8.3.40.0070.00719.04
8.3.30.0140.00419.52
8.3.20.0070.00020.29
8.3.10.0040.00422.34
8.3.00.0060.00322.75
8.2.180.0120.00616.75
8.2.170.0000.01422.96
8.2.160.0070.00720.68
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0030.00526.16
8.2.120.0080.00019.48
8.2.110.0060.00321.25
8.2.100.0060.00619.60
8.2.90.0060.00318.34
8.2.80.0000.00818.28
8.2.70.0030.00517.75
8.2.60.0030.00618.03
8.2.50.0050.00318.07
8.2.40.0080.00018.22
8.2.30.0060.00617.98
8.2.20.0040.00417.86
8.2.10.0040.00419.61
8.2.00.0040.00417.93
8.1.280.0100.00325.92
8.1.270.0050.00322.31
8.1.260.0000.00826.35
8.1.250.0050.00328.09
8.1.240.0080.00320.77
8.1.230.0040.00721.13
8.1.220.0060.00317.79
8.1.210.0040.00419.17
8.1.200.0040.00417.61
8.1.190.0040.00417.76
8.1.180.0040.00418.10
8.1.170.0030.00618.61
8.1.160.0030.00522.18
8.1.150.0040.00418.79
8.1.140.0040.00417.55
8.1.130.0000.00718.06
8.1.120.0040.00417.63
8.1.110.0080.00017.58
8.1.100.0000.00717.49
8.1.90.0040.00417.47
8.1.80.0070.00017.48
8.1.70.0030.00317.57
8.1.60.0000.00917.65
8.1.50.0040.00417.73
8.1.40.0040.00417.63
8.1.30.0080.00017.68
8.1.20.0030.00517.83
8.1.10.0030.00617.68
8.1.00.0030.00617.63
8.0.300.0050.00320.32
8.0.290.0040.00417.30
8.0.280.0040.00418.58
8.0.270.0030.00317.48
8.0.260.0030.00317.04
8.0.250.0000.00717.22
8.0.240.0030.00617.18
8.0.230.0070.00016.98
8.0.220.0000.00717.06
8.0.210.0030.00317.05
8.0.200.0000.00716.95
8.0.190.0000.00817.03
8.0.180.0050.00216.95
8.0.170.0000.00717.06
8.0.160.0080.00017.10
8.0.150.0000.00717.05
8.0.140.0050.00316.89
8.0.130.0030.00313.46
8.0.120.0050.00216.99
8.0.110.0050.00316.98
8.0.100.0000.00717.10
8.0.90.0000.00817.06
8.0.80.0080.00816.99
8.0.70.0000.00716.78
8.0.60.0040.00417.04
8.0.50.0040.00417.08
8.0.30.0090.01517.11
8.0.20.0120.00717.40
8.0.10.0040.00417.23
8.0.00.0170.00416.85
7.4.330.0060.00015.29
7.4.320.0000.00616.58
7.4.300.0030.00316.71
7.4.290.0030.00316.64
7.4.280.0030.00316.78
7.4.270.0000.00616.77
7.4.260.0020.00516.64
7.4.250.0040.00416.73
7.4.240.0030.00416.75
7.4.230.0030.00316.50
7.4.220.0090.00816.60
7.4.210.0050.01016.78
7.4.200.0000.00816.86
7.4.190.0050.00316.84
7.4.160.0060.00916.48
7.4.150.0070.01817.40
7.4.140.0110.01017.86
7.4.130.0100.00816.65
7.4.120.0100.00916.67
7.4.110.0080.00816.61
7.4.100.0090.00916.63
7.4.90.0060.01316.71
7.4.80.0060.01119.39
7.4.70.0130.00616.58
7.4.60.0060.01016.59
7.4.50.0030.00616.41
7.4.40.0040.01122.77
7.4.30.0060.01116.45
7.4.00.0030.01015.04
7.3.330.0050.00013.22
7.3.320.0000.00513.30
7.3.310.0030.00316.42
7.3.300.0060.00016.41
7.3.290.0100.01016.35
7.3.280.0080.00816.38
7.3.270.0130.01017.40
7.3.260.0070.01116.56
7.3.250.0090.00916.63
7.3.240.0100.01216.63
7.3.230.0100.00716.62
7.3.210.0090.00916.75
7.3.200.0140.00419.39
7.3.190.0060.01616.45
7.3.180.0060.00916.39
7.3.170.0070.00716.51
7.3.160.0100.00716.77
7.3.120.0090.00914.79
7.3.10.0060.00616.32
7.3.00.0100.00316.28
7.2.330.0100.01316.86
7.2.320.0180.00716.91
7.2.310.0030.01816.63
7.2.300.0070.01016.50
7.2.290.0060.01616.73
7.2.130.0100.00616.80
7.2.120.0040.01216.61
7.2.110.0120.00316.75
7.2.100.0080.00616.61
7.2.90.0130.00317.09
7.2.80.0100.00316.86
7.2.70.0060.00616.80
7.2.60.0030.01016.89
7.2.50.0030.01016.56
7.2.40.0120.00316.95
7.2.30.0110.00316.76
7.2.20.0070.00716.55
7.2.10.0040.01116.63
7.2.00.0060.00616.79
7.1.250.0070.00315.75
7.1.100.0030.00718.23
7.1.70.0030.00516.97
7.1.60.0070.01119.82
7.1.50.0070.01416.99
7.1.00.0000.07722.50
7.0.200.0080.00416.83
7.0.140.0000.07722.08
7.0.60.0000.07719.90
7.0.50.0130.07317.87
7.0.40.0070.04320.11
7.0.30.0430.07020.16
7.0.20.0200.05020.19
7.0.10.0100.07020.06
7.0.00.0070.05320.24
5.6.280.0030.07020.81
5.6.210.0130.07720.70
5.6.200.0070.08018.22
5.6.190.0070.08020.68
5.6.180.0030.04320.48
5.6.170.0300.05320.59
5.6.160.0070.04720.46
5.6.150.0030.07318.25
5.6.140.0070.07018.24
5.6.130.0030.06018.28
5.6.120.0100.08021.18
5.6.110.0070.08321.05
5.6.100.0230.07021.04
5.6.90.0070.08321.15
5.6.80.0130.07020.44
5.5.350.0100.06020.47
5.5.340.0130.04318.02
5.5.330.0000.05020.54
5.5.320.0130.04720.63
5.5.310.0270.08320.30
5.5.300.0000.04318.02
5.5.290.0100.03318.08
5.5.280.0070.06020.89
5.5.270.0100.05320.90
5.5.260.0070.04020.93
5.5.250.0070.05320.58
5.5.240.0130.05720.15
5.4.450.0800.03319.48
5.4.440.0900.04319.52
5.4.430.0800.04719.70
5.4.420.0730.06319.60
5.4.410.0600.05019.57
5.4.400.0800.05019.29
5.4.390.0670.05319.31
5.4.380.0330.05018.63
5.4.370.0400.04718.79
5.4.360.0300.07318.53
5.4.350.0300.04718.78
5.4.340.0300.05318.72
5.4.320.0080.03612.55
5.4.310.0060.03812.55
5.4.300.0070.03912.55
5.4.290.0080.05412.55
5.4.280.0050.03612.44
5.4.270.0100.07319.06
5.4.260.0170.06319.08
5.4.250.0130.05019.10
5.4.240.0030.06018.90
5.4.230.0170.05019.05
5.4.220.0070.07319.00
5.4.210.0100.05018.79
5.4.200.0170.06718.79
5.4.190.0030.08018.89
5.4.180.0200.04019.00
5.4.170.0170.05019.04
5.4.160.0100.06018.88
5.4.150.0070.05718.98
5.4.140.0100.05716.61
5.4.130.0070.05016.58
5.4.120.0200.04316.37
5.4.110.0100.07716.58
5.4.100.0070.07316.40
5.4.90.0070.07016.49
5.4.80.0030.06316.59
5.4.70.0070.07316.50
5.4.60.0200.04016.59
5.4.50.0130.05016.23
5.4.40.0070.04716.32
5.4.30.0070.07016.45
5.4.20.0170.05316.23
5.4.10.0070.06316.32
5.4.00.0100.06716.03
5.3.290.0100.03612.82
5.3.280.0100.07014.59
5.3.270.0100.05014.68
5.3.260.0170.07014.77
5.3.250.0030.05714.67
5.3.240.0070.06714.73
5.3.230.0070.05014.68
5.3.220.0130.07314.66
5.3.210.0130.05014.78
5.3.200.0030.05314.50
5.3.190.0100.07314.52
5.3.180.0000.06014.50
5.3.170.0170.06014.64
5.3.160.0100.05014.72
5.3.150.0100.05314.47
5.3.140.0100.07014.51
5.3.130.0070.05314.63
5.3.120.0000.06714.76
5.3.110.0100.05314.64
5.3.100.0070.05013.95
5.3.90.0170.06314.16
5.3.80.0070.06713.95
5.3.70.0030.06014.18
5.3.60.0100.05014.11
5.3.50.0100.06313.90
5.3.40.0070.06314.11
5.3.30.0100.04714.07
5.3.20.0230.05013.59
5.3.10.0070.04713.60
5.3.00.0000.07713.71
5.2.170.0030.04311.13
5.2.160.0130.03711.13
5.2.150.0100.05011.32
5.2.140.0000.07011.11
5.2.130.0130.04711.10
5.2.120.0100.04311.23
5.2.110.0030.04311.18
5.2.100.0130.03711.19
5.2.90.0070.04011.08
5.2.80.0100.05311.31
5.2.70.0170.03711.07
5.2.60.0000.04711.04
5.2.50.0030.06311.10
5.2.40.0200.04710.98
5.2.30.0070.04710.93
5.2.20.0070.04311.06
5.2.10.0070.04711.01
5.2.00.0070.04310.96
5.1.60.0000.04310.21
5.1.50.0100.03310.13
5.1.40.0130.02310.00
5.1.30.0030.05310.57
5.1.20.0170.02710.31
5.1.10.0070.03310.07
5.1.00.0100.02710.20
5.0.50.0030.0408.86
5.0.40.0070.0278.55
5.0.30.0000.0478.24
5.0.20.0000.0338.41
5.0.10.0100.0238.40
5.0.00.0070.0408.28
4.4.90.0100.0175.72
4.4.80.0000.0235.80
4.4.70.0030.0275.79
4.4.60.0000.0235.78
4.4.50.0000.0305.93
4.4.40.0070.0435.76
4.4.30.0070.0205.78
4.4.20.0030.0305.82
4.4.10.0100.0175.77
4.4.00.0030.0335.87
4.3.110.0000.0235.71
4.3.100.0030.0275.73
4.3.90.0030.0275.71
4.3.80.0100.0305.71
4.3.70.0070.0235.71
4.3.60.0070.0205.71
4.3.50.0070.0235.71
4.3.40.0000.0335.71
4.3.30.0030.0235.71
4.3.20.0000.0275.71
4.3.10.0000.0235.71
4.3.00.0200.01015.57

preferences:
55.61 ms | 400 KiB | 5 Q