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 = '<ns:feed xmlns:ns="http://www.w3.org/2005/Atom" xmlns:yt="http://gdata.youtube.com/schemas/2007"> <ns:entry> <yt:duration seconds="1870"/> </ns:entry> </ns:feed>'; $xml = new SimpleXMLElement($buffer); print_r($xml); echo "ibxml version: ", LIBXML_DOTTED_VERSION, "\n"; echo $xml->entry; 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.0120.00318.41
8.3.50.0140.00018.23
8.3.40.0060.00918.96
8.3.30.0090.00618.92
8.3.20.0050.00219.13
8.3.10.0070.00319.41
8.3.00.0050.00323.77
8.2.180.0060.00925.92
8.2.170.0150.00419.10
8.2.160.0110.01122.96
8.2.150.0070.00025.66
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0070.00021.12
8.2.110.0000.00921.20
8.2.100.0040.00718.14
8.2.90.0040.00418.15
8.2.80.0000.00918.05
8.2.70.0030.00618.05
8.2.60.0000.00818.02
8.2.50.0050.00318.10
8.2.40.0040.00419.52
8.2.30.0070.00019.54
8.2.20.0040.00718.21
8.2.10.0060.00318.45
8.2.00.0070.00019.65
8.1.280.0110.00425.92
8.1.270.0070.00024.66
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0040.00420.98
8.1.230.0090.00322.41
8.1.220.0030.00618.02
8.1.210.0080.00019.11
8.1.200.0060.00317.38
8.1.190.0060.00317.48
8.1.180.0060.00318.10
8.1.170.0040.00418.84
8.1.160.0000.00719.13
8.1.150.0040.00419.09
8.1.140.0000.00817.95
8.1.130.0040.00419.27
8.1.120.0000.00717.73
8.1.110.0040.00817.57
8.1.100.0000.00917.57
8.1.90.0000.00717.72
8.1.80.0030.00517.63
8.1.70.0060.00317.56
8.1.60.0030.00617.80
8.1.50.0030.00517.64
8.1.40.0080.00017.81
8.1.30.0000.00817.86
8.1.20.0040.00417.76
8.1.10.0030.00517.64
8.1.00.0000.00917.70
8.0.300.0000.00820.15
8.0.290.0030.00516.88
8.0.280.0000.00718.66
8.0.270.0070.00017.36
8.0.260.0030.00317.36
8.0.250.0000.00717.04
8.0.240.0000.00717.18
8.0.230.0020.00517.16
8.0.220.0070.00317.17
8.0.210.0070.00016.97
8.0.200.0040.00417.10
8.0.190.0060.00317.18
8.0.180.0040.00417.08
8.0.170.0030.00617.23
8.0.160.0030.00517.12
8.0.150.0000.00717.00
8.0.140.0000.00717.08
8.0.130.0000.00613.57
8.0.120.0090.00017.09
8.0.110.0080.00017.16
8.0.100.0040.00417.12
8.0.90.0040.00417.02
8.0.80.0030.01417.08
8.0.70.0040.00417.13
8.0.60.0040.00417.15
8.0.50.0070.00017.05
8.0.30.0080.01217.38
8.0.20.0150.00617.52
8.0.10.0000.00717.27
8.0.00.0070.01017.12
7.4.330.0050.00315.55
7.4.320.0030.00316.80
7.4.300.0060.00016.60
7.4.290.0030.00316.82
7.4.280.0050.00316.57
7.4.270.0000.01116.79
7.4.260.0030.00516.68
7.4.250.0040.00416.76
7.4.240.0030.00316.64
7.4.230.0000.00716.49
7.4.220.0040.00416.73
7.4.210.0100.00816.76
7.4.200.0030.00316.55
7.4.160.0110.00616.77
7.4.140.0120.00717.86
7.4.130.0080.00816.63
7.4.120.0100.01016.71
7.4.110.0070.01116.69
7.4.100.0150.00616.67
7.4.90.0150.00916.69
7.4.80.0130.00719.39
7.4.70.0110.00716.70
7.4.60.0040.01416.71
7.4.50.0040.01416.55
7.4.40.0030.01416.50
7.4.00.0140.00414.82
7.3.330.0000.00513.02
7.3.320.0060.00013.09
7.3.310.0030.00316.27
7.3.300.0030.00316.25
7.3.290.0030.00316.36
7.3.280.0100.01916.36
7.3.260.0100.00716.50
7.3.240.0110.00716.48
7.3.230.0160.00416.47
7.3.210.0090.01016.72
7.3.200.0120.01216.54
7.3.190.0090.00916.42
7.3.180.0060.00916.71
7.3.170.0040.01416.35
7.3.160.0090.00616.31
7.2.330.0120.00916.88
7.2.320.0060.01616.67
7.2.310.0040.01316.79
7.2.300.0050.01317.03
7.2.290.0120.00616.72
7.2.60.0450.01014.65
7.2.50.0400.00914.85
7.2.40.0440.01215.04
7.2.30.0400.00715.23
7.2.20.0490.00614.89
7.2.10.0380.00515.12
7.2.00.0270.01515.13
7.1.200.0090.00615.79
7.1.170.0360.00713.79
7.1.160.0320.00913.93
7.1.150.0560.00314.09
7.1.140.0400.00413.92
7.1.130.0370.00413.81
7.1.120.0860.00913.77
7.1.110.0360.00713.66
7.1.100.0500.00713.74
7.1.90.0500.00613.61
7.1.80.0430.00013.87
7.1.70.0460.00713.86
7.1.60.0650.01031.85
7.1.50.0610.01331.92
7.1.40.0290.01331.93
7.1.30.0630.00731.73
7.1.20.0580.00931.57
7.1.10.0420.00913.55
7.1.00.0440.00013.73

preferences:
54.86 ms | 400 KiB | 5 Q