3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<DATA <?xml version="1.0" encoding="UTF-8"?> <ns1:catalog xmlns:ns1="http://www.omnichannelintegrationlayer.com/xml/catalog/2016-01-01" catalog-id="at-master-catalog"> <ns1:product product-id="4132002004"> <ns1:min-order-quantity>1</ns1:min-order-quantity> <ns1:step-quantity>1</ns1:step-quantity> <ns1:short-description xmlns:ns2="xml" ns2:lang="de-AT">Jogginghose Cacy jr </ns1:short-description> <ns1:short-description xmlns:ns2="xml" ns2:lang="de-CH">Jogginghose Cacy jr </ns1:short-description> </ns1:product> </ns1:catalog> DATA; $xml = simplexml_load_string($xml); $productid = "4132002004"; $namespaces = $xml->getNamespaces(true); foreach ($xml->xpath("//ns1:product[@product-id='".$productid."']/ns1:short-description") as $short_description) { $langAsString = (string)$short_description->attributes($namespaces['ns2'])->lang; echo $langAsString . PHP_EOL; }

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.130.0050.00318.72
8.3.120.0060.00319.36
8.3.110.0100.00620.94
8.3.100.0060.00324.06
8.3.90.0080.00026.77
8.3.80.0000.00917.97
8.3.70.0120.00916.88
8.3.60.0100.00718.81
8.3.50.0070.00818.61
8.3.40.0090.00618.92
8.3.30.0100.00519.35
8.3.20.0060.00619.39
8.3.10.0040.00422.23
8.3.00.0060.00318.18
8.2.250.0110.00417.01
8.2.240.0060.00317.44
8.2.230.0090.00022.58
8.2.220.0040.00437.54
8.2.210.0060.00326.77
8.2.200.0000.01116.88
8.2.190.0110.01117.00
8.2.180.0190.00016.75
8.2.170.0110.01122.96
8.2.160.0120.00319.55
8.2.150.0040.00424.18
8.2.140.0030.00524.66
8.2.130.0080.00026.16
8.2.120.0040.00420.20
8.2.110.0040.00722.51
8.2.100.0040.00718.16
8.2.90.0080.00022.65
8.2.80.0000.00817.97
8.2.70.0000.00818.41
8.2.60.0030.00618.47
8.2.50.0040.00418.10
8.2.40.0030.00519.55
8.2.30.0000.00719.95
8.2.20.0030.00518.40
8.2.10.0050.00218.44
8.2.00.0040.00419.79
8.1.300.0000.00818.82
8.1.290.0090.00030.84
8.1.280.0070.01125.92
8.1.270.0040.00422.51
8.1.260.0030.00626.35
8.1.250.0030.00628.09
8.1.240.0100.00022.85
8.1.230.0000.01121.25
8.1.220.0040.00418.18
8.1.210.0040.00419.35
8.1.200.0000.00817.72
8.1.190.0000.00817.61
8.1.180.0030.00618.10
8.1.170.0000.00919.10
8.1.160.0050.00319.07
8.1.150.0000.00819.27
8.1.140.0030.00519.16
8.1.130.0000.00719.41
8.1.120.0050.00217.72
8.1.110.0040.00417.91
8.1.100.0040.00417.61
8.1.90.0030.00517.73
8.1.80.0000.00817.69
8.1.70.0030.00317.84
8.1.60.0040.00417.95
8.1.50.0000.00817.72
8.1.40.0080.00017.94
8.1.30.0030.00618.05
8.1.20.0000.00717.78
8.1.10.0020.00517.74
8.1.00.0030.00617.94
8.0.300.0000.00720.39
8.0.290.0040.00417.25
8.0.280.0030.00318.89
8.0.270.0000.00817.07
8.0.260.0030.00317.56
8.0.250.0080.00017.43
8.0.240.0030.00317.25
8.0.230.0030.00317.44
8.0.220.0020.00617.23
8.0.210.0070.00317.20
8.0.200.0030.00317.46
8.0.190.0080.00017.26
8.0.180.0080.00017.36
8.0.170.0050.00517.43
8.0.160.0030.00617.44
8.0.150.0040.00417.15
8.0.140.0040.00417.34
8.0.130.0000.00613.59
8.0.120.0040.00417.13
8.0.110.0040.00417.35
8.0.100.0000.00717.26
8.0.90.0040.00417.13
8.0.80.0130.00717.23
8.0.70.0000.00817.37
8.0.60.0000.00817.30
8.0.50.0000.00817.34
8.0.30.0120.00917.48
8.0.20.0160.01017.59
8.0.10.0000.00717.41
8.0.00.0080.00917.16
7.4.330.0030.00315.55
7.4.320.0050.00216.93
7.4.300.0030.00317.00
7.4.290.0000.00716.77
7.4.280.0050.00317.03
7.4.270.0030.00517.04
7.4.260.0080.00016.91
7.4.250.0070.00016.74
7.4.240.0080.00016.71
7.4.230.0070.00016.91
7.4.220.0030.00316.77
7.4.210.0100.00716.90
7.4.200.0040.00416.91
7.4.160.0080.00816.88
7.4.140.0080.01117.86
7.4.130.0060.01216.93
7.4.120.0110.00816.92
7.4.110.0070.01716.81
7.4.100.0060.01616.94
7.4.90.0070.01016.87
7.4.80.0140.00719.39
7.4.70.0090.00916.70
7.4.60.0090.00916.83
7.4.50.0030.00816.93
7.4.40.0090.00916.97
7.4.00.0030.01315.17
7.3.330.0000.00513.54
7.3.320.0060.00013.55
7.3.310.0000.00716.84
7.3.300.0030.00316.62
7.3.290.0060.00316.78
7.3.280.0070.00716.69
7.3.260.0090.01016.73
7.3.240.0100.01016.80
7.3.230.0030.01516.75
7.3.210.0060.01016.65
7.3.200.0070.01116.89
7.3.190.0160.00916.88
7.3.180.0120.00616.77
7.3.170.0030.01316.85
7.3.160.0070.00916.77
7.2.330.0150.00416.96
7.2.320.0120.00916.81
7.2.310.0110.00817.05
7.2.300.0130.01016.82
7.2.290.0040.01516.94
7.2.40.0470.01118.38
7.2.30.1280.00717.95
7.2.20.0560.00617.95
7.2.10.0710.00718.38
7.2.00.0790.01118.18
7.1.200.0070.00315.96
7.1.160.0620.00617.18
7.1.150.0530.01017.11
7.1.140.0570.01217.04
7.1.130.0710.01116.93
7.1.120.0770.00716.98
7.1.110.0740.01116.10
7.1.100.0980.01016.41
7.1.90.0680.00716.38
7.1.80.0730.00616.34
7.1.70.0720.00815.60
7.1.60.0840.00933.41
7.1.50.0800.01232.88
7.1.40.0670.01232.77
7.1.30.0810.00632.79
7.1.20.0760.01232.92
7.1.10.0620.00814.92
7.1.00.0520.00814.90

preferences:
28.07 ms | 403 KiB | 5 Q