3v4l.org

run code in 300+ PHP versions simultaneously
<?php Reproduce code: --------------- $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 ); /* Expected result: ---------------- string(5) "a:foo" string(5) "b:bar" string(5) "b:bar" Actual result: ---------------- string(5) "a:foo" string(5) "a:foo" string(5) "b:bar" */

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)
5.4.290.0020.04312.48
5.4.280.0080.03312.37
5.4.270.0060.03712.37
5.4.260.0070.03612.38
5.4.250.0060.04012.38
5.4.240.0120.03512.37
5.4.230.0110.03712.37
5.4.220.0110.05012.36
5.4.210.0110.04312.36
5.4.200.0100.05012.37
5.4.190.0100.04312.36
5.4.180.0070.05312.36
5.4.170.0100.03912.37
5.4.160.0080.04112.37
5.4.150.0150.05812.36
5.4.140.0120.05912.05
5.4.130.0100.03312.03
5.4.120.0110.03212.00
5.4.110.0090.03712.00
5.4.100.0040.03811.99
5.4.90.0110.05311.99
5.4.80.0040.04211.99
5.4.70.0060.03511.99
5.4.60.0070.03612.00
5.4.50.0120.03311.99
5.4.40.0090.03211.98
5.4.30.0100.03311.98
5.4.20.0080.03611.97
5.4.10.0080.03511.97
5.4.00.0080.05211.46
5.3.280.0090.04812.71
5.3.270.0130.04512.72
5.3.260.0130.04012.72
5.3.250.0080.04312.71
5.3.240.0070.04112.72
5.3.230.0070.04612.71
5.3.220.0060.06512.68
5.3.210.0070.04212.67
5.3.200.0060.04312.68
5.3.190.0050.04112.68
5.3.180.0080.03612.68
5.3.170.0090.03612.66
5.3.160.0080.04312.67
5.3.150.0060.04012.67
5.3.140.0030.05012.66
5.3.130.0050.04112.66
5.3.120.0040.04312.66
5.3.110.0080.03912.66
5.3.100.0080.03812.12
5.3.90.0110.03912.08
5.3.80.0080.03612.08
5.3.70.0090.03512.07
5.3.60.0060.03912.06
5.3.50.0090.03412.00
5.3.40.0070.03612.00
5.3.30.0070.03611.95
5.3.20.0080.04611.73
5.3.10.0110.04911.70
5.3.00.0130.05911.68

preferences:
132.99 ms | 1398 KiB | 7 Q