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)); var_dump($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.10.0140.00616.84
8.5.00.0150.00620.07
8.4.150.0020.00014.05
8.4.140.0140.00917.57
8.4.130.0130.00817.97
8.4.120.0120.00824.43
8.4.110.0150.00622.63
8.4.100.0120.00817.94
8.4.90.0140.00617.79
8.4.80.0150.00518.15
8.4.70.0090.01117.71
8.4.60.0070.01317.95
8.4.50.0100.00618.89
8.4.40.0130.00319.32
8.4.30.0150.00022.68
8.4.20.0140.00720.72
8.4.10.0160.00317.73
8.3.280.0130.00718.69
8.3.270.0110.01016.66
8.3.260.0060.01316.68
8.3.250.0070.00219.08
8.3.240.0110.00916.72
8.3.230.0120.00716.70
8.3.220.0120.00717.34
8.3.210.0100.00616.84
8.3.200.0160.00416.65
8.3.190.0130.00716.68
8.3.180.0050.00418.55
8.3.170.0060.01219.03
8.3.160.0140.00718.45
8.3.150.0120.00616.84
8.3.140.0060.00317.40
8.3.130.0090.00018.75
8.3.120.0090.00020.78
8.3.110.0060.00316.66
8.3.100.0100.00716.70
8.3.90.0090.00926.77
8.3.80.0070.00316.88
8.3.70.0070.01417.00
8.3.60.0100.01016.88
8.3.50.0110.00618.41
8.3.40.0120.00618.90
8.3.30.0180.00018.79
8.3.20.0040.00421.82
8.3.10.0000.00723.75
8.3.00.0050.00321.03
8.2.290.0060.00320.61
8.2.280.0060.00218.63
8.2.270.0150.00319.29
8.2.260.0040.00416.88
8.2.250.0060.00316.86
8.2.240.0070.01117.50
8.2.230.0040.00420.94
8.2.220.0030.00524.06
8.2.210.0040.00426.77
8.2.200.0030.00618.66
8.2.190.0070.01416.88
8.2.180.0180.00325.92
8.2.170.0120.00918.96
8.2.160.0040.01122.96
8.2.150.0060.00925.66
8.2.140.0080.00024.66
8.2.130.0080.00020.02
8.2.120.0040.00426.35
8.2.110.0040.00419.39
8.2.100.0080.00418.03
8.2.90.0030.00618.00
8.2.80.0000.00818.05
8.2.70.0030.00518.05
8.2.60.0000.00818.16
8.2.50.0000.00818.10
8.2.40.0070.00019.55
8.2.30.0000.00719.53
8.2.20.0040.00418.19
8.2.10.0020.00519.54
8.2.00.0040.00419.54
8.1.330.0110.00816.82
8.1.320.0120.00916.52
8.1.310.0120.00618.75
8.1.300.0030.00618.33
8.1.290.0070.00330.84
8.1.280.0110.00425.92
8.1.270.0040.00418.87
8.1.260.0000.00826.35
8.1.250.0070.00028.09
8.1.240.0060.00620.89
8.1.230.0110.00021.09
8.1.220.0040.00417.74
8.1.210.0060.00318.77
8.1.200.0030.00617.60
8.1.190.0080.00017.47
8.1.180.0040.00418.10
8.1.170.0080.00018.77
8.1.160.0040.00419.12
8.1.150.0000.00719.02
8.1.140.0000.00720.95
8.1.130.0050.00520.25
8.1.120.0050.00217.60
8.1.110.0000.00817.74
8.1.100.0040.00417.60
8.1.90.0040.00417.73
8.1.80.0040.00717.61
8.1.70.0030.00517.75
8.1.60.0040.00417.82
8.1.50.0040.00417.78
8.1.40.0040.00417.78
8.1.30.0040.00417.75
8.1.20.0000.01117.83
8.1.10.0040.00417.89
8.1.00.0040.00417.64
8.0.300.0000.00720.15
8.0.290.0000.00916.88
8.0.280.0030.00318.64
8.0.270.0000.00817.41
8.0.260.0000.00618.71
8.0.250.0050.00317.27
8.0.240.0070.00017.19
8.0.230.0000.00717.20
8.0.220.0000.00717.20
8.0.210.0000.00717.24
8.0.200.0040.00417.30
8.0.190.0040.00417.10
8.0.180.0030.00517.16
8.0.170.0000.00817.24
8.0.160.0020.00517.23
8.0.150.0050.00217.09
8.0.140.0030.00517.16
8.0.130.0000.00613.64
8.0.120.0040.00417.18
8.0.110.0040.00417.08
8.0.100.0070.00017.21
8.0.90.0000.00717.16
8.0.80.0090.00617.18
8.0.70.0070.00017.02
8.0.60.0040.00417.20
8.0.50.0040.00417.05
8.0.30.0030.01717.34
8.0.20.0130.00617.29
8.0.10.0040.00417.23
8.0.00.0110.00917.05
7.4.330.0000.00715.55
7.4.320.0040.00416.70
7.4.300.0050.00216.73
7.4.290.0040.00416.82
7.4.280.0000.00916.55
7.4.270.0000.00716.75
7.4.260.0070.00016.80
7.4.250.0070.00016.78
7.4.240.0040.00416.69
7.4.230.0020.00516.86
7.4.220.0040.00416.79
7.4.210.0100.00416.75
7.4.200.0080.00016.82
7.4.160.0080.00716.80
7.4.140.0110.00717.86
7.4.130.0030.01316.88
7.4.120.0030.01516.69
7.4.110.0070.01016.69
7.4.100.0160.00516.79
7.4.90.0130.00416.84
7.4.80.0110.00619.39
7.4.70.0100.00616.65
7.4.60.0070.01016.62
7.4.50.0090.00616.53
7.4.40.0100.01016.88
7.4.00.0050.01114.91
7.3.330.0000.00513.29
7.3.320.0030.00313.28
7.3.310.0040.00416.50
7.3.300.0070.00016.52
7.3.290.0030.00316.43
7.3.280.0120.00916.50
7.3.260.0120.00716.49
7.3.240.0070.01316.56
7.3.230.0140.00416.43
7.3.210.0120.00916.59
7.3.200.0050.01116.68
7.3.190.0120.00616.36
7.3.180.0030.01616.45
7.3.170.0150.00616.73
7.3.160.0120.00816.62
7.3.120.0030.01014.98
7.3.110.0070.01014.69
7.3.100.0060.01014.82
7.3.90.0030.00914.89
7.3.80.0030.01014.86
7.3.70.0040.01114.66
7.3.60.0040.00814.64
7.3.50.0030.01014.63
7.3.40.0060.01014.93
7.3.30.0040.01114.61
7.3.20.0050.00516.45
7.3.10.0040.01015.87
7.3.00.0290.00515.84
7.2.330.0030.01416.63
7.2.320.0070.01016.74
7.2.310.0100.00616.89
7.2.300.0000.01717.02
7.2.290.0120.00617.03
7.2.250.0140.00415.29
7.2.240.0060.01015.29
7.2.230.0090.00915.12
7.2.220.0070.01015.04
7.2.210.0030.00615.11
7.2.200.0030.00615.04
7.2.190.0060.00615.35
7.2.180.0040.01115.11
7.2.170.0060.00314.94
7.2.130.1550.00315.13
7.2.120.1600.00715.08
7.2.110.0950.01014.77
7.2.100.0880.00314.80
7.2.90.0750.00714.97
7.2.80.0350.01015.11
7.2.70.0830.01015.21
7.2.60.0260.00715.27
7.2.50.0120.00615.22
7.2.40.0260.01015.00
7.2.30.0030.01015.09
7.2.20.1120.00715.09
7.2.10.0140.00715.05
7.2.00.0100.01615.16
7.1.330.0070.00715.79
7.1.320.0070.00716.05
7.1.310.0030.00715.94
7.1.300.0070.00315.93
7.1.290.0100.00315.90
7.1.280.0100.00315.69
7.1.270.0070.00715.76
7.1.260.0030.01015.79
7.1.250.1260.01013.74

preferences:
185.63 ms | 403 KiB | 5 Q