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 = '<feed xmlns="http://www.w3.org/2005/Atom" xmlns:yt="http://gdata.youtube.com/schemas/2007"> <entry> <yt:duration seconds="1870"/> </entry> </feed>'; $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.40.0120.00318.89
8.3.30.0110.00418.93
8.3.20.0040.00419.35
8.3.10.0060.00621.20
8.3.00.0080.00023.83
8.2.170.0040.01122.96
8.2.160.0100.00720.82
8.2.150.0070.00024.18
8.2.140.0040.00424.66
8.2.130.0030.00618.34
8.2.120.0040.00426.35
8.2.110.0090.00021.30
8.2.100.0040.00718.16
8.2.90.0040.00419.47
8.2.80.0000.00818.29
8.2.70.0030.00718.05
8.2.60.0080.00018.29
8.2.50.0080.00018.10
8.2.40.0040.00419.66
8.2.30.0070.00019.67
8.2.20.0040.00718.32
8.2.10.0000.00718.29
8.2.00.0050.00319.61
8.1.270.0040.00420.45
8.1.260.0000.00926.35
8.1.250.0080.00028.09
8.1.240.0030.00721.16
8.1.230.0070.00417.93
8.1.220.0030.00517.80
8.1.210.0040.00418.77
8.1.200.0030.00617.48
8.1.190.0040.00417.48
8.1.180.0000.00818.10
8.1.170.0080.00018.87
8.1.160.0040.00419.20
8.1.150.0000.00719.09
8.1.140.0050.00217.81
8.1.130.0070.00019.23
8.1.120.0000.00717.78
8.1.110.0030.00617.61
8.1.100.0000.00717.54
8.1.90.0040.00417.70
8.1.80.0000.00717.62
8.1.70.0070.00317.59
8.1.60.0030.00617.79
8.1.50.0100.00017.75
8.1.40.0040.00417.71
8.1.30.0050.00317.86
8.1.20.0000.00817.82
8.1.10.0050.00317.64
8.1.00.0000.00817.71
8.0.300.0050.00318.77
8.0.290.0090.00017.00
8.0.280.0000.00718.54
8.0.270.0050.00317.49
8.0.260.0060.00017.57
8.0.250.0000.00917.21
8.0.240.0040.00417.19
8.0.230.0040.00417.04
8.0.220.0040.00417.14
8.0.210.0040.00417.00
8.0.200.0040.00417.12
8.0.190.0050.00317.05
8.0.180.0030.00517.00
8.0.170.0030.00616.99
8.0.160.0030.00517.16
8.0.150.0040.00417.12
8.0.140.0050.00217.11
8.0.130.0000.00513.62
8.0.120.0050.00316.98
8.0.110.0040.00417.15
8.0.100.0000.00817.04
8.0.90.0040.00417.10
8.0.80.0180.00517.06
8.0.70.0030.00616.97
8.0.60.0000.00817.14
8.0.50.0040.00417.09
8.0.30.0130.00717.15
8.0.20.0050.01517.48
8.0.10.0080.00017.07
8.0.00.0090.00916.99
7.4.330.0060.00015.55
7.4.320.0030.00316.74
7.4.300.0040.00416.72
7.4.290.0040.00416.73
7.4.280.0000.00816.63
7.4.270.0090.00016.61
7.4.260.0050.00216.78
7.4.250.0000.00716.69
7.4.240.0050.00316.74
7.4.230.0040.00316.92
7.4.220.0030.00316.92
7.4.210.0100.00616.70
7.4.200.0030.00516.59
7.4.160.0060.01016.74
7.4.140.0110.00917.86
7.4.130.0100.00716.82
7.4.120.0100.01016.68
7.4.110.0100.00716.63
7.4.100.0140.00316.89
7.4.90.0130.00316.86
7.4.80.0140.00919.39
7.4.70.0040.01316.89
7.4.60.0110.00516.70
7.4.50.0060.00616.51
7.4.40.0090.01316.74
7.4.00.0030.01515.30
7.3.330.0000.00613.21
7.3.320.0060.00013.38
7.3.310.0040.00416.29
7.3.300.0030.00316.55
7.3.290.0040.00416.46
7.3.280.0030.01216.42
7.3.260.0110.00616.57
7.3.240.0100.00916.67
7.3.230.0100.00716.67
7.3.210.0070.01316.45
7.3.200.0100.00716.77
7.3.190.0090.00916.80
7.3.180.0080.00816.66
7.3.170.0090.01216.66
7.3.160.0100.00716.54
7.2.330.0070.01016.90
7.2.320.0120.01217.00
7.2.310.0120.00616.91
7.2.300.0120.00616.73
7.2.290.0090.01516.90
7.2.60.0160.01314.55
7.2.50.0290.00714.93
7.2.40.0310.00914.51
7.2.30.0360.00315.13
7.2.20.0300.01115.18
7.2.10.0290.00315.13
7.2.00.0170.01215.19
7.1.200.0120.00015.87
7.1.170.0180.00713.75
7.1.160.0350.00313.41
7.1.150.0290.00913.64
7.1.140.0240.00413.96
7.1.130.0300.00713.91
7.1.120.0280.00014.03
7.1.110.0080.00814.10
7.1.100.0250.00414.09
7.1.90.0340.00714.05
7.1.80.0140.01114.01
7.1.70.0270.01013.85
7.1.60.0510.01332.05
7.1.50.0440.02031.76
7.1.40.0490.01331.88
7.1.30.0300.01731.72
7.1.20.0400.01232.05
7.1.10.0260.00314.07
7.1.00.0190.00813.69

preferences:
49.22 ms | 400 KiB | 5 Q