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"; echo $xml->entry->yt; 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.00318.55
8.3.50.0130.00318.18
8.3.40.0070.00719.09
8.3.30.0120.00318.82
8.3.20.0040.00419.32
8.3.10.0030.00719.41
8.3.00.0080.00023.68
8.2.180.0130.00318.65
8.2.170.0070.00722.96
8.2.160.0130.00720.64
8.2.150.0060.00324.18
8.2.140.0030.00624.66
8.2.130.0060.00318.34
8.2.120.0040.00426.35
8.2.110.0030.00620.78
8.2.100.0090.00318.47
8.2.90.0030.00517.88
8.2.80.0050.00319.09
8.2.70.0000.00817.75
8.2.60.0040.00417.75
8.2.50.0080.00018.18
8.2.40.0000.00919.73
8.2.30.0030.00519.72
8.2.20.0070.00318.49
8.2.10.0050.00218.34
8.2.00.0000.00819.65
8.1.280.0100.00725.92
8.1.270.0070.00020.63
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0080.00323.94
8.1.230.0040.00821.16
8.1.220.0030.00618.80
8.1.210.0000.00818.77
8.1.200.0050.00317.60
8.1.190.0060.00317.48
8.1.180.0000.00818.10
8.1.170.0040.00417.62
8.1.160.0000.00719.18
8.1.150.0000.00819.07
8.1.140.0050.00217.90
8.1.130.0000.00719.27
8.1.120.0080.00017.73
8.1.110.0040.00417.75
8.1.100.0040.00417.75
8.1.90.0000.00817.70
8.1.80.0080.00017.57
8.1.70.0000.00917.58
8.1.60.0000.00817.84
8.1.50.0040.00417.78
8.1.40.0050.00317.65
8.1.30.0000.00817.95
8.1.20.0000.00817.91
8.1.10.0060.00317.83
8.1.00.0040.00417.75
8.0.300.0040.00418.77
8.0.290.0040.00417.00
8.0.280.0070.00018.57
8.0.270.0030.00517.46
8.0.260.0000.00617.39
8.0.250.0070.00017.12
8.0.240.0070.00017.00
8.0.230.0050.00217.12
8.0.220.0030.00517.17
8.0.210.0030.00317.02
8.0.200.0000.00817.20
8.0.190.0000.00817.28
8.0.180.0000.00817.02
8.0.170.0080.00017.11
8.0.160.0040.00417.20
8.0.150.0060.00317.16
8.0.140.0040.00417.16
8.0.130.0060.00013.50
8.0.120.0080.00017.05
8.0.110.0030.00617.20
8.0.100.0080.00017.00
8.0.90.0050.00317.10
8.0.80.0100.00717.06
8.0.70.0070.00016.93
8.0.60.0000.00717.11
8.0.50.0080.00017.18
8.0.30.0080.01117.33
8.0.20.0110.00817.49
8.0.10.0040.00417.17
8.0.00.0140.00816.88
7.4.330.0000.00615.55
7.4.320.0060.00016.75
7.4.300.0050.00216.79
7.4.290.0000.00716.83
7.4.280.0000.00716.88
7.4.270.0030.00616.74
7.4.260.0050.00216.66
7.4.250.0000.00716.68
7.4.240.0040.00416.66
7.4.230.0070.00016.74
7.4.220.0080.00016.94
7.4.210.0080.01016.80
7.4.200.0000.00716.83
7.4.160.0110.00816.79
7.4.140.0130.00617.86
7.4.130.0160.00016.82
7.4.120.0110.00916.72
7.4.110.0100.00716.66
7.4.100.0130.00316.80
7.4.90.0150.00416.55
7.4.80.0170.00419.39
7.4.70.0090.00916.85
7.4.60.0140.00316.65
7.4.50.0060.00916.79
7.4.40.0170.00716.74
7.4.00.0110.00715.20
7.3.330.0030.00313.32
7.3.320.0030.00313.35
7.3.310.0000.00716.37
7.3.300.0000.00616.46
7.3.290.0000.00716.32
7.3.280.0030.01716.45
7.3.260.0120.00816.63
7.3.240.0090.00916.66
7.3.230.0060.01216.76
7.3.210.0060.01316.61
7.3.200.0160.00716.62
7.3.190.0060.01116.44
7.3.180.0130.01016.75
7.3.170.0100.00716.51
7.3.160.0130.00916.64
7.3.120.0070.01114.73
7.3.110.0080.01114.79
7.3.100.0040.01214.92
7.3.90.0110.00414.76
7.3.80.0040.01114.86
7.3.70.0090.00915.01
7.3.60.0040.01414.86
7.3.50.0030.00714.74
7.3.40.0090.00914.77
7.3.30.0060.00614.96
7.3.20.0000.00916.63
7.3.10.0030.00916.46
7.3.00.0070.00716.49
7.2.330.0100.00717.00
7.2.320.0090.01217.00
7.2.310.0070.01116.61
7.2.300.0080.00816.79
7.2.290.0090.01216.72
7.2.240.0000.01714.65
7.2.230.0060.00914.84
7.2.220.0030.01015.23
7.2.210.0000.01414.89
7.2.200.0110.00415.22
7.2.190.0070.00715.21
7.2.180.0040.01115.21
7.2.170.0100.01015.03
7.2.160.0030.01314.83
7.2.150.0110.00417.07
7.2.140.0130.00317.04
7.2.130.0090.00617.07
7.2.120.0060.00616.76
7.2.110.0090.00616.78
7.2.100.0070.01016.75
7.2.90.0090.00316.66
7.2.80.0060.00816.80
7.2.70.0060.00316.77
7.2.60.0120.01316.02
7.2.50.0230.00816.17
7.2.40.0100.00816.13
7.2.30.0160.00916.17
7.2.20.0130.00816.03
7.2.10.0130.00916.09
7.2.00.0140.01016.07
7.1.330.0070.00715.50
7.1.320.0090.00315.65
7.1.310.0000.00915.75
7.1.300.0000.01515.71
7.1.290.0070.01115.73
7.1.280.0070.01115.79
7.1.270.0060.00915.61
7.1.260.0030.01415.93
7.1.250.0060.00615.72
7.1.200.0100.00015.84
7.1.170.0350.00413.92
7.1.160.0210.00613.77
7.1.150.0210.00613.85
7.1.140.0250.00413.88
7.1.130.0200.00914.02
7.1.120.0210.00713.67
7.1.110.0250.00413.83
7.1.100.0260.00413.96
7.1.90.0260.00613.76
7.1.80.0340.01313.87
7.1.70.0260.00613.88
7.1.60.0380.01931.84
7.1.50.0480.01632.14
7.1.40.0570.01331.93
7.1.30.0570.01031.77
7.1.20.0500.01532.05
7.1.10.0730.00313.82
7.1.00.0200.00913.99

preferences:
81.48 ms | 400 KiB | 5 Q