3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dom = new DOMDocument(); $dom->loadXML( '<foobar><a:foo xmlns:a="urn:a">'. '<b:bar xmlns:b="urn:b"/></a:foo>'. '</foobar>' ); $xpath = new DOMXPath($dom); //get context node and check "a:foo" $context = $dom->documentElement->firstChild; var_dump($context->tagName); // try to override the context node $xpath->registerNamespace('a', 'urn:b'); var_dump( $xpath->evaluate( 'descendant-or-self::a:*', $context )->item(0)->tagName ); // use a prefix not used in context $xpath->registerNamespace('prefix', 'urn:b'); var_dump( $xpath->evaluate( 'descendant-or-self::prefix:*', $context )->item(0)->tagName );

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.0110.00416.88
8.3.50.0100.01022.08
8.3.40.0120.00819.09
8.3.30.0040.01219.34
8.3.20.0040.00420.58
8.3.10.0080.00023.98
8.3.00.0070.00317.75
8.2.180.0140.00718.36
8.2.170.0120.00322.96
8.2.160.0110.00420.46
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00422.50
8.2.110.0060.00321.56
8.2.100.0000.01217.97
8.2.90.0040.00419.42
8.2.80.0040.00417.97
8.2.70.0000.00917.88
8.2.60.0040.00418.18
8.2.50.0040.00418.07
8.2.40.0000.00918.47
8.2.30.0040.00418.24
8.2.20.0000.00818.07
8.2.10.0050.00218.41
8.2.00.0030.00717.92
8.1.280.0180.00325.92
8.1.270.0040.00424.22
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0060.00322.40
8.1.230.0040.00717.64
8.1.220.0040.00417.88
8.1.210.0070.00718.77
8.1.200.0000.01017.48
8.1.190.0040.00417.68
8.1.180.0030.00619.38
8.1.170.0050.00318.76
8.1.160.0060.00322.34
8.1.150.0080.00318.80
8.1.140.0030.00617.55
8.1.130.0070.00018.18
8.1.120.0060.00317.85
8.1.110.0000.00717.63
8.1.100.0050.00317.73
8.1.90.0000.00717.70
8.1.80.0000.00717.83
8.1.70.0030.00317.71
8.1.60.0100.00317.89
8.1.50.0080.00017.89
8.1.40.0040.00417.87
8.1.30.0040.00417.90
8.1.20.0040.00417.89
8.1.10.0000.00817.96
8.1.00.0030.00517.71
8.0.300.0000.00818.77
8.0.290.0020.00516.88
8.0.280.0000.00718.75
8.0.270.0000.00717.42
8.0.260.0030.00317.52
8.0.250.0000.00717.32
8.0.240.0000.00717.07
8.0.230.0050.00217.21
8.0.220.0030.00317.20
8.0.210.0040.00417.23
8.0.200.0030.00617.34
8.0.190.0080.00017.13
8.0.180.0030.00617.25
8.0.170.0000.00817.12
8.0.160.0070.00016.98
8.0.150.0070.00017.15
8.0.140.0040.00416.94
8.0.130.0030.00313.42
8.0.120.0050.00317.19
8.0.110.0000.00817.14
8.0.100.0050.00317.09
8.0.90.0040.00417.03
8.0.80.0090.00917.24
8.0.70.0000.00817.13
8.0.60.0040.00417.23
8.0.50.0000.00716.95
8.0.30.0100.00817.40
8.0.20.0070.01117.40
8.0.10.0030.00317.23
8.0.00.0090.00917.01
7.4.330.0000.00515.34
7.4.320.0000.00716.68
7.4.300.0070.00016.74
7.4.290.0040.00416.81
7.4.280.0050.00316.92
7.4.270.0040.00416.90
7.4.260.0000.00816.81
7.4.250.0040.00416.80
7.4.240.0050.00316.83
7.4.230.0030.00317.05
7.4.220.0130.00316.98
7.4.210.0050.01016.91
7.4.200.0000.00816.92
7.4.190.0040.00417.13
7.4.160.0100.01316.76
7.4.150.0140.00417.40
7.4.140.0040.01317.86
7.4.130.0110.00616.79
7.4.120.0080.01216.84
7.4.110.0100.00716.84
7.4.100.0150.00316.75
7.4.90.0130.00716.76
7.4.80.0140.00319.39
7.4.70.0130.00316.71
7.4.60.0060.01616.82
7.4.50.0030.00616.97
7.4.40.0070.00722.77
7.4.30.0120.00616.78
7.4.00.0110.00515.17
7.3.330.0050.00013.32
7.3.320.0030.00313.43
7.3.310.0040.00416.60
7.3.300.0030.00316.44
7.3.290.0070.00716.53
7.3.280.0090.00816.52
7.3.270.0000.01817.40
7.3.260.0000.02016.75
7.3.250.0040.01516.72
7.3.240.0060.00916.52
7.3.230.0090.00816.50
7.3.210.0140.00316.69
7.3.200.0120.01019.39
7.3.190.0110.01116.51
7.3.180.0100.00716.53
7.3.170.0070.01016.72
7.3.160.0070.00916.72
7.3.120.0040.00915.08
7.3.110.0100.00715.05
7.3.100.0090.00614.56
7.3.90.0060.00315.24
7.3.80.0040.00814.99
7.3.70.0000.01314.79
7.3.60.0100.00614.56
7.3.50.0000.01014.75
7.3.40.0040.01114.64
7.3.30.0120.00814.76
7.3.20.0000.01416.66
7.3.10.0060.00616.51
7.3.00.0050.00516.68
7.2.330.0060.01117.00
7.2.320.0110.00816.80
7.2.310.0070.01016.89
7.2.300.0100.00716.93
7.2.290.0140.00316.86
7.2.250.0090.00915.05
7.2.240.0070.01415.34
7.2.230.0060.00915.25
7.2.220.0030.00615.18
7.2.210.0030.00915.01
7.2.200.0030.01015.09
7.2.190.0070.00715.11
7.2.180.0030.00615.01
7.2.170.0030.01014.86
7.2.130.0100.00317.16
7.2.120.0040.01116.97
7.2.110.0040.00716.93
7.2.100.0030.00916.89
7.2.90.0030.01016.93
7.2.80.0070.01016.97
7.2.70.0060.01016.86
7.2.60.0070.00716.58
7.2.50.0100.00616.90
7.2.40.0030.01416.91
7.2.30.0090.00617.05
7.2.20.0030.01316.93
7.2.10.0030.01216.99
7.2.00.0070.00718.28
7.1.330.0070.00715.79
7.1.320.0060.00915.88
7.1.310.0040.00816.00
7.1.300.0040.00416.09
7.1.290.0040.00415.94
7.1.280.0060.00916.00
7.1.270.0110.00716.07
7.1.260.0040.01215.85
7.1.250.0030.00615.90
7.1.240.0130.00015.93
7.1.230.0070.00715.91
7.1.220.0070.00715.68
7.1.210.0070.00715.82
7.1.200.0000.01115.93
7.1.190.0040.01115.91
7.1.180.0060.00615.87
7.1.170.0070.00416.00
7.1.160.0030.01015.62
7.1.150.0110.00315.82
7.1.140.0100.00315.69
7.1.130.0030.00715.71
7.1.120.0100.00015.95
7.1.110.0030.00615.95
7.1.100.0480.00716.20
7.1.90.0100.00315.87
7.1.80.0070.01115.96
7.1.70.0030.00916.54
7.1.60.0100.01017.65
7.1.50.0070.01116.35
7.1.40.0000.01416.01
7.1.30.0090.00615.84
7.1.20.0030.01015.93
7.1.10.0110.00415.73
7.1.00.0020.04619.19
7.0.330.0120.00015.41
7.0.320.0100.00315.52
7.0.310.0060.00615.18
7.0.300.0060.00615.42
7.0.290.0030.01215.25
7.0.280.0050.00515.52
7.0.270.0030.01015.55
7.0.260.0040.00815.57
7.0.250.0030.01015.51
7.0.240.0090.00615.51
7.0.230.0060.01015.47
7.0.220.0030.01015.37
7.0.210.0110.00315.68
7.0.200.0020.00816.02
7.0.190.0030.01015.60
7.0.180.0090.00315.33
7.0.170.0090.00615.65
7.0.160.0030.00715.80
7.0.150.0030.01015.50
7.0.140.0040.03918.85
7.0.130.0100.00015.48
7.0.120.0100.00315.57
7.0.110.0070.00715.44
7.0.100.0030.00915.42
7.0.90.0100.00715.49
7.0.80.0060.00915.39
7.0.70.0130.00015.43
7.0.60.0030.04517.77
7.0.50.0080.02216.78
7.0.40.0100.04316.99
7.0.30.0130.03417.10
7.0.20.0150.03717.00
7.0.10.0130.03216.97
7.0.00.0050.02516.91
5.6.380.0040.01114.43
5.6.370.0060.01014.39
5.6.360.0070.00314.31
5.6.350.0060.00314.54
5.6.340.0110.00714.38
5.6.330.0070.00714.72
5.6.320.0040.01114.26
5.6.310.0000.01414.50
5.6.300.0030.00914.46
5.6.290.0060.00314.47
5.6.280.0000.04517.94
5.6.270.0000.01014.21
5.6.260.0110.00314.30
5.6.250.0070.00714.18
5.6.240.0000.01014.31
5.6.230.0040.01114.67
5.6.220.0090.00614.40
5.6.210.0070.04017.51
5.6.200.0070.04016.34
5.6.190.0090.02217.47
5.6.180.0140.02317.52
5.6.170.0180.03317.48
5.6.160.0120.04017.40
5.6.150.0050.03216.30
5.6.140.0040.03816.34
5.6.130.0000.03316.29
5.6.120.0060.03617.79
5.6.110.0050.05017.80
5.6.100.0100.04217.60
5.6.90.0100.04217.72
5.6.80.0050.03817.51
5.6.70.2290.01817.37
5.6.60.0030.01014.36
5.6.50.0070.00714.27
5.6.40.0060.00614.61
5.6.30.0000.01114.21
5.6.20.0110.00314.18
5.6.10.0060.00314.07
5.6.00.0060.00913.97
5.5.380.0030.00711.16
5.5.370.0000.00711.29
5.5.360.0030.00610.82
5.5.350.0100.04215.85
5.5.340.0050.03414.56
5.5.330.0100.02815.69
5.5.320.0160.02315.82
5.5.310.0150.02915.60
5.5.300.0050.04214.55
5.5.290.0070.04214.60
5.5.280.0030.04815.99
5.5.270.0020.04816.03
5.5.260.0090.04215.96
5.5.250.0060.03315.88
5.5.240.0180.04015.68
5.5.230.0000.00811.26
5.5.220.0100.00310.95
5.5.210.0090.00310.86
5.5.200.0070.00411.13
5.5.190.0070.00011.14
5.5.180.0030.00511.25
5.5.170.0060.00610.98
5.5.160.0000.01211.00
5.5.150.0000.00811.19
5.5.140.0000.01110.95
5.5.130.0000.01211.03
5.5.120.0040.00410.85
5.5.110.0030.00311.24
5.5.100.0030.00610.93
5.5.90.0000.00811.07
5.5.80.0070.00311.03
5.5.70.0050.00211.07
5.5.60.0030.00710.88
5.5.50.0000.01011.04
5.5.40.0000.00611.12
5.5.30.0000.00910.93
5.5.20.0040.00411.16
5.5.10.0040.00411.00
5.5.00.0000.01010.95
5.4.450.0450.03015.45
5.4.440.0450.03315.41
5.4.430.0400.03115.33
5.4.420.0380.03115.29
5.4.410.0480.02215.20
5.4.400.0480.03715.19
5.4.390.0380.03215.10
5.4.380.0250.03514.97
5.4.370.0120.03115.00
5.4.360.0160.02714.89
5.4.350.0170.02814.89
5.4.340.0230.02714.89
5.4.330.0000.00810.73
5.4.320.0040.02311.84
5.4.310.0050.02311.72
5.4.300.0050.02211.84
5.4.290.0040.02411.81
5.4.280.0060.02011.71
5.4.270.0070.01911.74
5.4.260.0070.02111.79
5.4.250.0080.02011.81
5.4.240.0060.02311.84
5.4.230.0080.02711.84
5.4.220.0080.02611.70
5.4.210.0060.02011.83
5.4.200.0100.02411.74
5.4.190.0070.02811.82
5.4.180.0070.02111.84
5.4.170.0040.03311.82
5.4.160.0070.02511.87
5.4.150.0060.03111.69
5.4.140.0080.03011.73
5.4.130.0100.02311.55
5.4.120.0060.03011.51
5.4.110.0020.02311.50
5.4.100.0050.02011.47
5.4.90.0080.02111.54
5.4.80.0050.02111.52
5.4.70.0070.02011.53
5.4.60.0090.02811.59
5.4.50.0050.02211.60
5.4.40.0060.02311.60
5.4.30.0070.02511.56
5.4.20.0040.02411.53
5.4.10.0020.02411.60
5.4.00.0050.03211.10
5.3.290.0090.02011.73
5.3.280.0080.02611.74
5.3.270.0070.03011.71
5.3.260.0070.02611.74
5.3.250.0080.03411.72
5.3.240.0060.02611.74
5.3.230.0060.02011.72
5.3.220.0060.02011.69
5.3.210.0050.02611.69
5.3.200.0050.02711.63
5.3.190.0050.02511.63
5.3.180.0060.02011.74
5.3.170.0070.02111.76
5.3.160.0040.02211.67
5.3.150.0080.02711.76
5.3.140.0070.03011.65
5.3.130.0050.02611.62
5.3.120.0090.02111.71
5.3.110.0080.02211.74
5.3.100.0060.02411.35
5.3.90.0060.02211.44
5.3.80.0040.02611.38
5.3.70.0040.02111.29
5.3.60.0050.02111.43
5.3.50.0060.02211.36
5.3.40.0040.02611.36
5.3.30.0040.02511.37
5.3.20.0060.01911.24
5.3.10.0070.02011.10
5.3.00.0060.03011.13
5.2.170.0060.0189.55
5.2.160.0060.0169.55
5.2.150.0030.0189.55
5.2.140.0040.0199.55
5.2.130.0080.0239.53
5.2.120.0020.0259.53
5.2.110.0040.0209.53
5.2.100.0030.0169.53
5.2.90.0020.0209.53
5.2.80.0060.0209.52
5.2.70.0030.0219.52
5.2.60.0050.0199.50
5.2.50.0040.0209.48
5.2.40.0030.0189.47
5.2.30.0040.0169.46
5.2.20.0030.0199.46
5.2.10.0040.0189.41
5.2.00.0070.0269.35
5.1.60.0050.0218.99
5.1.50.0090.0158.99
5.1.40.0070.0258.98
5.1.30.0050.0249.15
5.1.20.0060.0219.16
5.1.10.0090.0239.03
5.1.00.0060.0149.02
5.0.50.0050.0188.24
5.0.40.0050.0218.18
5.0.30.0040.0218.08
5.0.20.0080.0218.07
5.0.10.0050.0228.06
5.0.00.0080.0278.05
4.4.90.0070.0187.22
4.4.80.0050.0167.21
4.4.70.0040.0097.21
4.4.60.0020.0117.20
4.4.50.0020.0147.21
4.4.40.0020.0197.18
4.4.30.0050.0157.21
4.4.20.0020.0237.25
4.4.10.0010.0117.25
4.4.00.0060.0187.21
4.3.110.0060.0147.16
4.3.100.0100.0127.16
4.3.90.0050.0117.14
4.3.80.0020.0217.12
4.3.70.0030.0157.14
4.3.60.0040.0117.14
4.3.50.0020.0157.14
4.3.40.0020.0227.10
4.3.30.0020.0156.47
4.3.20.0020.0136.46
4.3.10.0030.0136.44
4.3.00.0220.0109.98

preferences:
42.42 ms | 401 KiB | 5 Q