3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<XML <?xml version="1.0" ?> <root xmlns:foo="uri:foo" /> XML; $doc = new DOMDocument(); $doc->loadXML($xml); // These have special-case handling at the PHP level to redirect the lookup to the libxml namespace store // https://lxr.room11.org/xref/php-src%407.2/ext/dom/element.c#285 var_dump($doc->documentElement->hasAttribute('xmlns:foo')); var_dump($doc->documentElement->getAttribute('xmlns:foo')); // This directly retrieves the libxml attribute store, which does not include the namespace declarations // https://lxr.room11.org/xref/php-src%407.2/ext/dom/node.c#569 var_dump(count($doc->documentElement->attributes)); foreach ($doc->documentElement->attributes as $attribute) { var_dump($attribute->nodeName, $attribute->nodeValue); }

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.5.00.0130.01120.00
8.4.150.0010.00114.05
8.4.140.0120.00817.67
8.4.130.0100.00918.14
8.4.120.0120.00820.75
8.4.110.0150.00622.52
8.4.100.0130.00718.12
8.4.90.0130.01020.70
8.4.80.0050.00617.81
8.4.70.0100.01017.86
8.4.60.0080.00318.98
8.4.50.0140.00618.11
8.4.40.0070.01417.77
8.4.30.0170.00317.73
8.4.20.0140.00719.38
8.4.10.0060.00319.61
8.3.280.0100.01018.72
8.3.270.0120.00916.55
8.3.260.0120.00716.71
8.3.250.0120.00619.27
8.3.240.0060.00216.73
8.3.230.0110.00816.75
8.3.220.0100.01117.20
8.3.210.0100.00716.76
8.3.200.0020.00616.59
8.3.190.0110.00817.32
8.3.180.0090.01016.48
8.3.170.0160.00319.11
8.3.160.0090.00918.41
8.3.150.0110.00719.32
8.3.140.0080.00016.85
8.3.130.0130.00916.89
8.3.120.0040.00418.99
8.3.110.0120.00320.94
8.3.100.0070.00724.06
8.3.90.0030.00526.77
8.3.80.0070.00417.97
8.3.70.0070.00718.39
8.3.60.0110.00418.43
8.3.50.0150.00218.49
8.3.40.0120.00319.00
8.3.30.0090.00918.83
8.3.20.0030.00522.22
8.3.10.0080.00023.82
8.3.00.0040.00419.97
8.2.290.0110.00721.00
8.2.280.0090.00618.85
8.2.270.0000.00916.68
8.2.260.0030.00519.12
8.2.250.0060.00318.79
8.2.240.0130.00619.06
8.2.230.0000.00822.58
8.2.220.0090.00037.54
8.2.210.0070.00726.77
8.2.200.0070.00718.91
8.2.190.0130.00617.13
8.2.180.0000.01518.79
8.2.170.0130.00622.96
8.2.160.0070.00721.35
8.2.150.0060.00324.18
8.2.140.0000.00824.66
8.2.130.0040.00421.32
8.2.120.0060.00326.35
8.2.110.0040.00422.28
8.2.100.0080.00319.58
8.2.90.0050.00318.03
8.2.80.0040.00419.53
8.2.70.0080.00018.05
8.2.60.0080.00018.29
8.2.50.0040.00418.40
8.2.40.0070.00022.60
8.2.30.0040.00419.67
8.2.20.0000.00818.30
8.2.10.0050.00218.42
8.2.00.0040.00418.55
8.1.330.0110.00820.77
8.1.320.0120.00816.58
8.1.310.0170.00017.11
8.1.300.0060.01318.20
8.1.290.0090.00030.84
8.1.280.0070.00725.92
8.1.270.0000.00720.44
8.1.260.0040.00426.35
8.1.250.0060.00328.09
8.1.240.0040.00422.31
8.1.230.0070.00421.16
8.1.220.0080.00017.91
8.1.210.0030.00518.94
8.1.200.0000.00817.48
8.1.190.0000.00817.35
8.1.180.0050.00318.10
8.1.170.0040.00418.77
8.1.160.0070.00019.20
8.1.150.0070.00020.41
8.1.140.0040.00417.83
8.1.130.0030.00319.13
8.1.120.0030.00317.54
8.1.110.0040.00417.71
8.1.100.0070.00317.73
8.1.90.0040.00417.73
8.1.80.0030.00517.74
8.1.70.0030.00517.76
8.1.60.0040.00417.75
8.1.50.0030.00517.78
8.1.40.0040.00717.79
8.1.30.0090.00017.97
8.1.20.0080.00017.94
8.1.10.0040.00417.77
8.1.00.0050.00217.73
8.0.300.0080.00020.14
8.0.290.0040.00417.00
8.0.280.0000.00718.63
8.0.270.0070.00017.48
8.0.260.0030.00317.01
8.0.250.0070.00017.28
8.0.240.0050.00317.31
8.0.230.0030.00317.21
8.0.220.0000.00717.21
8.0.210.0000.00717.11
8.0.200.0070.00017.16
8.0.190.0000.00717.11
8.0.180.0040.00417.20
8.0.170.0040.00417.24
8.0.160.0000.00717.22
8.0.150.0040.00417.12
8.0.140.0080.00017.21
8.0.130.0000.00513.56
8.0.120.0000.00816.99
8.0.110.0050.00217.08
8.0.100.0000.00717.09
8.0.90.0000.00817.20
8.0.80.0100.00717.17
8.0.70.0040.00417.21
8.0.60.0040.00417.16
8.0.50.0000.00717.00
8.0.30.0120.00517.34
8.0.20.0100.00917.42
8.0.10.0050.00217.25
8.0.00.0070.01117.02
7.4.330.0000.00515.55
7.4.320.0030.00316.75
7.4.300.0000.00616.86
7.4.290.0000.00816.61
7.4.280.0040.00416.74
7.4.270.0000.00716.81
7.4.260.0020.00516.71
7.4.250.0040.00416.71
7.4.240.0000.00716.70
7.4.230.0000.00716.69
7.4.220.0070.00016.85
7.4.210.0090.01216.74
7.4.200.0000.00716.50
7.4.160.0090.00716.71
7.4.150.0100.00917.40
7.4.140.0120.00717.86
7.4.130.0090.00916.80
7.4.120.0080.01116.66
7.4.110.0070.01016.67
7.4.100.0070.01016.72
7.4.90.0090.00916.68
7.4.80.0080.01619.39
7.4.70.0150.00516.80
7.4.60.0090.00616.80
7.4.50.0060.00916.56
7.4.40.0130.00616.82
7.4.00.0050.01115.06
7.3.330.0030.00313.35
7.3.320.0050.00013.31
7.3.310.0040.00416.58
7.3.300.0000.00716.55
7.3.290.0110.00816.54
7.3.280.0090.00516.53
7.3.270.0110.01017.40
7.3.260.0120.00716.55
7.3.250.0100.01016.61
7.3.240.0100.01016.58
7.3.230.0180.00016.73
7.3.210.0190.00316.50
7.3.200.0030.01616.77
7.3.190.0060.01016.50
7.3.180.0120.00916.50
7.3.170.0130.00316.54
7.3.160.0090.00616.46
7.3.120.0050.01114.92
7.3.110.0050.00814.89
7.3.100.0130.00314.85
7.3.90.0100.00314.72
7.3.80.0040.00914.74
7.3.70.0080.00614.78
7.3.60.0040.01014.85
7.3.50.0050.00814.68
7.3.40.0070.00914.68
7.3.30.0080.00714.86
7.3.20.0030.00916.54
7.3.10.0070.00916.54
7.3.00.0090.00516.72
7.2.330.0150.00316.54
7.2.320.0000.02316.92
7.2.310.0150.00616.71
7.2.300.0120.01217.00
7.2.290.0160.00016.93
7.2.250.0080.00815.05
7.2.240.0050.01414.92
7.2.230.0050.01015.33
7.2.220.0050.00914.95
7.2.210.0050.00714.87
7.2.200.0040.00714.99
7.2.190.0050.01015.17
7.2.180.0080.01015.00
7.2.170.0060.01114.98
7.2.60.0060.00617.12
7.2.10.0420.00818.14
7.2.00.0350.00717.64
7.1.330.0010.01215.75
7.1.320.0080.00515.60
7.1.310.0090.00415.66
7.1.300.0020.01215.64
7.1.290.0050.01015.55
7.1.280.0080.00515.76
7.1.270.0030.00815.84
7.1.260.0070.00615.68
7.1.200.0040.00415.93
7.1.130.0350.01016.55
7.1.120.0590.01016.83
7.1.110.0340.01215.84
7.1.100.0400.00316.01
7.1.90.0500.01715.86
7.1.80.0440.01316.43
7.1.70.0470.01315.48
7.1.60.0510.01433.29
7.1.50.0530.01433.05
7.1.40.0480.01432.78
7.1.30.0760.01032.82
7.1.20.0560.00932.77
7.1.10.0330.01514.82
7.1.00.0520.00615.01

preferences:
20.73 ms | 403 KiB | 5 Q