3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * How to get attribute of node with namespace using SimpleXML? * * @link http://stackoverflow.com/q/6576773/367456 */ $buffer = '<?xml version="1.0" encoding="utf-8" standalone="yes"?> <ns:quoteRS xmlns:ns="http://www.allianz.com/emagin/api/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" xsi:schemaLocation="http://www.allianz.com/emagin/bs/common/v1 bs_common_v1.xsd http://www.allianz.com/emagin/bs/quote/v1 bs_quote_v1.xsd http://www.allianz.com/emagin/bs/domain/travel/v1 bs_domain_travel_v1.xsd"> <ns:status code="ERROR"/> <ns:messages> <ns:message code="NO_PRODUCT_AVAILABLE" lang="en" level="info">No offer matching the quotation request.</ns:message> </ns:messages> </ns:quoteRS>'; $xml = new SimpleXMLElement($buffer); print_r($xml); echo "ibxml version: ", LIBXML_DOTTED_VERSION, "\n"; foreach ($xml->entry as $item) { //original comment: how to get seconds? $namespaces = $item->getNameSpaces(true); $yt = $item->children($namespaces['yt']); $seconds = $yt->duration->attributes(); echo $seconds['seconds'], "\n"; // original comment: but doesn't work. } echo "done. should read 1870 one time.\n";

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.0150.00718.59
8.3.50.0120.00618.11
8.3.40.0080.00819.04
8.3.30.0160.00018.80
8.3.20.0040.00418.97
8.3.10.0040.00721.00
8.3.00.0080.00023.86
8.2.180.0120.00917.00
8.2.170.0040.01122.96
8.2.160.0140.00322.24
8.2.150.0030.00524.18
8.2.140.0030.00524.66
8.2.130.0100.00018.05
8.2.120.0030.00526.35
8.2.110.0030.00722.55
8.2.100.0000.01117.81
8.2.90.0000.00819.22
8.2.80.0000.00818.12
8.2.70.0120.00018.05
8.2.60.0000.00918.05
8.2.50.0030.00618.10
8.2.40.0050.00319.59
8.2.30.0040.00419.71
8.2.20.0030.00718.25
8.2.10.0070.00018.31
8.2.00.0040.00419.71
8.1.280.0150.00425.92
8.1.270.0040.00422.28
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0050.00521.22
8.1.230.0080.00317.85
8.1.220.0080.00017.93
8.1.210.0030.00618.77
8.1.200.0030.00617.48
8.1.190.0030.00617.35
8.1.180.0000.00818.10
8.1.170.0050.00318.77
8.1.160.0040.00419.08
8.1.150.0040.00419.21
8.1.140.0000.00717.87
8.1.130.0030.00319.23
8.1.120.0040.00417.59
8.1.110.0100.00017.64
8.1.100.0000.00717.52
8.1.90.0040.00417.63
8.1.80.0030.00517.76
8.1.70.0030.00717.69
8.1.60.0000.01017.89
8.1.50.0040.00417.75
8.1.40.0050.00317.79
8.1.30.0080.00017.76
8.1.20.0040.00417.77
8.1.10.0000.00817.75
8.1.00.0080.00017.71
8.0.300.0000.00718.77
8.0.290.0050.00316.88
8.0.280.0030.00318.66
8.0.270.0070.00017.43
8.0.260.0060.00017.49
8.0.250.0030.00617.08
8.0.240.0030.00517.27
8.0.230.0070.00017.07
8.0.220.0050.00317.15
8.0.210.0060.00017.06
8.0.200.0030.00317.14
8.0.190.0000.00817.01
8.0.180.0060.00317.19
8.0.170.0050.00317.14
8.0.160.0040.00417.13
8.0.150.0040.00417.11
8.0.140.0070.00017.05
8.0.130.0000.00613.51
8.0.120.0040.00416.98
8.0.110.0040.00416.88
8.0.100.0080.00016.96
8.0.90.0030.00517.23
8.0.80.0070.01317.09
8.0.70.0000.00716.98
8.0.60.0040.00417.09
8.0.50.0040.00417.13
8.0.30.0080.01117.34
8.0.20.0110.00817.40
8.0.10.0060.00317.28
8.0.00.0130.00816.92
7.4.330.0030.00315.55
7.4.320.0030.00316.75
7.4.300.0060.00016.80
7.4.290.0000.00916.63
7.4.280.0030.00616.79
7.4.270.0000.00916.74
7.4.260.0080.00016.71
7.4.250.0000.00816.81
7.4.240.0030.00316.62
7.4.230.0000.00716.64
7.4.220.0080.00016.81
7.4.210.0130.00216.83
7.4.200.0000.00716.84
7.4.160.0070.01016.68
7.4.140.0100.01117.86
7.4.130.0100.00716.61
7.4.120.0130.00816.67
7.4.110.0150.00916.59
7.4.100.0100.00716.83
7.4.90.0140.00416.72
7.4.80.0070.01119.39
7.4.70.0060.01316.71
7.4.60.0100.00716.71
7.4.50.0000.01616.80
7.4.40.0080.01116.63
7.4.00.0030.01014.94
7.3.330.0020.00213.26
7.3.320.0050.00013.08
7.3.310.0000.00816.43
7.3.300.0030.00316.40
7.3.290.0020.00516.29
7.3.280.0080.01016.38
7.3.260.0090.00916.59
7.3.240.0070.01116.52
7.3.230.0120.00916.64
7.3.210.0070.01316.62
7.3.200.0060.01016.76
7.3.190.0110.00716.67
7.3.180.0060.00916.43
7.3.170.0120.00916.70
7.3.160.0100.00616.43
7.3.10.0050.00916.51
7.3.00.0070.01016.51
7.2.330.0090.00916.91
7.2.320.0030.01516.91
7.2.310.0060.01217.02
7.2.300.0070.01016.61
7.2.290.0140.00316.67
7.2.130.0060.00716.89
7.2.120.0130.00916.87
7.2.110.0080.00816.84
7.2.100.0340.00716.51
7.2.90.0080.00816.75
7.2.80.0440.00416.83
7.2.70.0110.00816.96
7.2.60.0190.00816.51
7.2.50.0140.01016.27
7.2.40.0260.00616.35
7.2.30.0230.01216.33
7.2.20.0130.01116.24
7.2.10.0140.01316.28
7.2.00.0230.00916.31
7.1.250.0070.00515.87
7.1.200.0030.00615.91
7.1.170.0200.00714.09
7.1.160.0220.00913.91
7.1.150.0280.01114.27
7.1.140.0250.00913.89
7.1.130.0320.00514.14
7.1.120.0260.00413.68
7.1.110.0260.00314.05
7.1.100.0920.00913.75
7.1.90.0170.01314.12
7.1.80.0190.01114.01
7.1.70.0170.01014.02
7.1.60.0500.00631.88
7.1.50.0400.00931.89
7.1.40.0310.01331.77
7.1.30.0300.01831.80
7.1.20.0430.00831.80
7.1.10.0160.01614.00
7.1.00.0260.00813.93

preferences:
85.54 ms | 401 KiB | 5 Q