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); $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.0140.00718.53
8.3.50.0090.00618.14
8.3.40.0140.00319.01
8.3.30.0090.00619.20
8.3.20.0050.00220.46
8.3.10.0040.00422.26
8.3.00.0050.00322.69
8.2.180.0070.01116.88
8.2.170.0140.00722.96
8.2.160.0110.00320.38
8.2.150.0000.00724.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00419.50
8.2.110.0090.00019.46
8.2.100.0090.00319.70
8.2.90.0050.00318.05
8.2.80.0060.00319.07
8.2.70.0000.00817.63
8.2.60.0000.00817.75
8.2.50.0000.00817.75
8.2.40.0080.00017.75
8.2.30.0000.01018.23
8.2.20.0040.00417.83
8.2.10.0080.00019.53
8.2.00.0030.00617.87
8.1.270.0060.00322.36
8.1.260.0000.00826.35
8.1.250.0030.00528.09
8.1.240.0030.00724.05
8.1.230.0030.00717.89
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0040.00417.48
8.1.190.0110.00017.36
8.1.180.0030.00518.10
8.1.170.0050.00317.62
8.1.160.0040.00422.14
8.1.150.0040.00418.76
8.1.140.0000.00817.57
8.1.130.0040.00418.06
8.1.120.0030.00517.61
8.1.110.0020.00517.41
8.1.100.0000.00717.60
8.1.90.0070.00317.47
8.1.80.0000.00717.61
8.1.70.0000.00717.56
8.1.60.0000.00817.77
8.1.50.0000.00717.61
8.1.40.0000.00717.57
8.1.30.0040.00417.74
8.1.20.0040.00417.86
8.1.10.0000.00717.74
8.1.00.0060.00617.59
8.0.300.0040.00418.77
8.0.290.0000.00716.88
8.0.280.0040.00418.63
8.0.270.0030.00316.90
8.0.260.0030.00316.89
8.0.250.0000.00717.22
8.0.240.0090.00017.13
8.0.230.0000.00717.00
8.0.220.0000.00716.94
8.0.210.0030.00317.04
8.0.200.0030.00317.09
8.0.190.0000.00817.07
8.0.180.0070.00016.93
8.0.170.0000.00716.93
8.0.160.0050.00317.05
8.0.150.0070.00016.84
8.0.140.0000.00816.89
8.0.130.0000.00713.46
8.0.120.0000.00816.93
8.0.110.0000.00816.92
8.0.100.0040.00417.02
8.0.90.0050.00216.91
8.0.80.0030.01316.96
8.0.70.0040.00417.12
8.0.60.0040.00416.84
8.0.50.0000.00717.05
8.0.30.0200.00217.15
8.0.20.0110.00817.45
8.0.10.0070.00017.20
8.0.00.0090.01016.92
7.4.330.0000.00515.18
7.4.320.0030.00316.70
7.4.300.0060.00016.77
7.4.290.0030.00316.61
7.4.280.0050.00316.71
7.4.270.0070.00016.57
7.4.260.0000.00716.72
7.4.250.0000.00716.59
7.4.240.0040.00316.68
7.4.230.0030.00316.49
7.4.220.0100.00716.61
7.4.210.0070.00716.75
7.4.200.0030.00316.63
7.4.190.0000.00916.86
7.4.160.0070.01016.71
7.4.150.0110.01417.40
7.4.140.0100.01117.86
7.4.130.0140.00316.59
7.4.120.0070.01016.67
7.4.110.0100.00616.63
7.4.100.0110.01116.64
7.4.90.0090.00916.46
7.4.80.0200.00319.39
7.4.70.0080.00916.65
7.4.60.0100.00716.64
7.4.50.0030.00616.48
7.4.40.0000.01022.77
7.4.30.0100.00716.76
7.4.00.0030.01215.09
7.3.330.0030.00313.25
7.3.320.0050.00013.28
7.3.310.0040.00416.50
7.3.300.0070.00016.40
7.3.290.0090.00916.34
7.3.280.0080.00816.43
7.3.270.0070.01017.40
7.3.260.0120.01216.51
7.3.250.0080.00916.51
7.3.240.0090.01516.37
7.3.230.0100.00716.45
7.3.210.0100.00716.62
7.3.200.0070.01019.39
7.3.190.0060.01516.55
7.3.180.0060.01016.70
7.3.170.0100.01016.63
7.3.160.0060.00916.61
7.3.120.0090.00614.89
7.2.330.0110.00516.83
7.2.320.0160.02216.91
7.2.310.0080.00817.01
7.2.300.0060.00916.93
7.2.290.0040.01416.74
7.2.60.0040.00816.93
7.2.50.0070.00417.02
7.2.00.0030.01019.31
7.1.200.0060.00915.55
7.1.100.0060.00318.21
7.1.70.0080.00017.10
7.1.60.0040.00819.82
7.1.50.0060.01516.94
7.1.00.0030.07722.35
7.0.200.0030.00616.73
7.0.140.0000.07722.04
7.0.60.0470.05320.07
7.0.50.0070.05717.90
7.0.40.0070.07719.97
7.0.30.0230.07020.24
7.0.20.0270.08320.36
7.0.10.0270.07720.23
7.0.00.0100.07320.24
5.6.280.0070.06320.96
5.6.210.0070.07720.63
5.6.200.0000.04718.25
5.6.190.0100.06320.46
5.6.180.3330.05020.68
5.6.170.0170.07320.68
5.6.160.0130.04320.56
5.6.150.0130.07718.19
5.6.140.0030.08718.17
5.6.130.0170.06718.21
5.6.120.0000.08721.02
5.6.110.0070.07321.15
5.6.100.0130.06721.07
5.6.90.0100.07721.01
5.6.80.0030.09020.52
5.5.350.0470.06320.51
5.5.340.0070.03318.09
5.5.330.0070.08720.35
5.5.320.0230.03720.28
5.5.310.0070.05320.37
5.5.300.0100.06718.07
5.5.290.0070.07718.01
5.5.280.0100.08020.93
5.5.270.0100.08320.80
5.5.260.0070.08720.98
5.5.250.0100.06320.62
5.5.240.0170.07720.18
5.4.450.0770.05319.54
5.4.440.0230.06019.55
5.4.430.0130.05319.48
5.4.420.0100.05719.69
5.4.410.0100.06718.84
5.4.400.0370.05018.75
5.4.390.0400.04718.80
5.4.380.0130.07018.81
5.4.370.0130.05318.67
5.4.360.0070.05318.83
5.4.350.0040.03612.07
5.4.340.0040.03612.06
5.4.320.0100.03112.55
5.4.310.0070.04512.55
5.4.300.0060.04212.55
5.4.290.0040.04512.54
5.4.280.0090.04412.45
5.4.270.0100.07318.90
5.4.260.0070.05719.00
5.4.250.0070.08018.95
5.4.240.0130.05019.05
5.4.230.0100.07718.70
5.4.220.0070.07018.92
5.4.210.0100.05718.96
5.4.200.0100.05018.71
5.4.190.0100.06018.93
5.4.180.0130.06018.91
5.4.170.0070.06318.89
5.4.160.0070.06318.94
5.4.150.0130.07018.98
5.4.140.0130.04716.41
5.4.130.0070.05016.58
5.4.120.0100.06016.60
5.4.110.0170.04716.37
5.4.100.0130.05316.64
5.4.90.0200.06316.62
5.4.80.0130.07016.52
5.4.70.0130.04716.61
5.4.60.0130.04716.30
5.4.50.0070.07316.29
5.4.40.0130.06716.59
5.4.30.0100.04716.50
5.4.20.0030.07716.38
5.4.10.0070.06316.56
5.4.00.0130.05715.77
5.3.290.0040.04012.81
5.3.280.0030.08314.48
5.3.270.0100.05714.69
5.3.260.0170.06714.59
5.3.250.0100.07314.82
5.3.240.0030.06014.74
5.3.230.0100.05714.54
5.3.220.0130.07014.55
5.3.210.0130.06714.63
5.3.200.0100.06714.80
5.3.190.0070.07314.78
5.3.180.0070.05314.48
5.3.170.0100.07014.50
5.3.160.0200.06314.45
5.3.150.0100.04714.64
5.3.140.0100.07014.47
5.3.130.0130.05014.76
5.3.120.0030.08314.63
5.3.110.0030.06314.45
5.3.100.0170.06014.12
5.3.90.0170.05014.10
5.3.80.0070.06714.10
5.3.70.0170.04314.10
5.3.60.0100.06313.92
5.3.50.0130.06013.93
5.3.40.0000.06314.05
5.3.30.0230.04714.12
5.3.20.0030.07013.59
5.3.10.0030.05313.77
5.3.00.0100.07013.72
5.2.170.0000.05011.23
5.2.160.0130.03711.12
5.2.150.0070.05711.11
5.2.140.0070.05311.10
5.2.130.0070.05711.26
5.2.120.0030.04311.07
5.2.110.0070.05011.08
5.2.100.0130.03311.27
5.2.90.0100.03711.17
5.2.80.0030.04711.05
5.2.70.0030.06011.18
5.2.60.0100.03711.13
5.2.50.0130.04711.10
5.2.40.0070.04311.01
5.2.30.0100.03710.98
5.2.20.0130.04711.02
5.2.10.0070.04011.00
5.2.00.0100.04010.84
5.1.60.0100.03710.02
5.1.50.0070.03710.21
5.1.40.0170.0409.96
5.1.30.0030.04310.48
5.1.20.0100.04710.39
5.1.10.0100.04710.07
5.1.00.0070.03310.22
5.0.50.0030.0408.58
5.0.40.0100.0278.39
5.0.30.0070.0408.20
5.0.20.0070.0278.28
5.0.10.0030.0338.27
5.0.00.0070.0538.19
4.4.90.0000.0236.09
4.4.80.0000.0336.09
4.4.70.0000.0336.09
4.4.60.0100.0206.09
4.4.50.0070.0236.09
4.4.40.0030.0376.09
4.4.30.0070.0176.09
4.4.20.0030.0206.09
4.4.10.0030.0336.09
4.4.00.0000.0376.09
4.3.110.0030.0236.09
4.3.100.0070.0276.09
4.3.90.0170.0106.09
4.3.80.0000.0406.09
4.3.70.0000.0276.09
4.3.60.0030.0276.09
4.3.50.0000.0236.09
4.3.40.0070.0406.09
4.3.30.0030.0206.09
4.3.20.0070.0206.09
4.3.10.0000.0306.09
4.3.00.0200.0237.01

preferences:
59.31 ms | 400 KiB | 5 Q