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); 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['seconds']; echo $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.70.0110.00418.41
8.3.60.0120.00318.80
8.3.50.0050.01318.45
8.3.40.0110.00419.17
8.3.30.0090.00619.05
8.3.20.0040.00419.21
8.3.10.0070.00419.23
8.3.00.0040.00423.76
8.2.190.0120.00316.75
8.2.180.0130.00716.88
8.2.170.0040.01122.96
8.2.160.0070.01022.38
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0070.00318.09
8.2.120.0080.00026.35
8.2.110.0040.00722.40
8.2.100.0120.00018.16
8.2.90.0040.00419.17
8.2.80.0050.00317.97
8.2.70.0080.00318.18
8.2.60.0000.00818.28
8.2.50.0090.00018.10
8.2.40.0000.00719.46
8.2.30.0000.00719.77
8.2.20.0000.00918.38
8.2.10.0070.00018.29
8.2.00.0050.00319.55
8.1.280.0070.00725.92
8.1.270.0040.00420.57
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0040.00424.10
8.1.230.0080.00317.89
8.1.220.0000.00818.04
8.1.210.0030.00618.77
8.1.200.0030.00617.48
8.1.190.0030.00617.35
8.1.180.0080.00018.10
8.1.170.0080.00018.84
8.1.160.0040.00419.07
8.1.150.0000.00719.08
8.1.140.0070.00017.88
8.1.130.0070.00019.21
8.1.120.0000.00717.64
8.1.110.0000.01017.63
8.1.100.0050.00217.56
8.1.90.0030.00417.55
8.1.80.0030.00517.69
8.1.70.0030.00717.70
8.1.60.0040.00417.73
8.1.50.0040.00417.75
8.1.40.0000.00817.62
8.1.30.0030.00517.91
8.1.20.0000.00817.86
8.1.10.0040.00417.71
8.1.00.0080.00017.76
8.0.300.0040.00418.77
8.0.290.0060.00316.88
8.0.280.0000.00718.61
8.0.270.0040.00417.45
8.0.260.0030.00317.41
8.0.250.0030.00317.01
8.0.240.0040.00417.14
8.0.230.0070.00017.25
8.0.220.0030.00317.02
8.0.210.0000.00717.15
8.0.200.0000.00717.21
8.0.190.0000.00817.22
8.0.180.0040.00417.02
8.0.170.0040.00417.19
8.0.160.0000.00717.07
8.0.150.0030.00517.05
8.0.140.0040.00417.02
8.0.130.0000.00513.56
8.0.120.0080.00017.04
8.0.110.0030.00517.05
8.0.100.0070.00017.05
8.0.90.0040.00417.19
8.0.80.0110.00717.09
8.0.70.0040.00417.02
8.0.60.0070.00017.11
8.0.50.0040.00417.18
8.0.30.0110.00717.26
8.0.20.0100.00917.40
8.0.10.0040.00417.24
8.0.00.0180.00317.03
7.4.330.0000.00615.55
7.4.320.0030.00316.63
7.4.300.0030.00316.63
7.4.290.0030.00316.80
7.4.280.0000.00816.88
7.4.270.0080.00316.72
7.4.260.0080.00016.66
7.4.250.0000.00716.69
7.4.240.0030.00316.88
7.4.230.0000.00716.82
7.4.220.0040.00416.61
7.4.210.0050.01116.74
7.4.200.0070.00016.53
7.4.160.0110.00516.70
7.4.140.0100.00917.86
7.4.130.0090.00816.73
7.4.120.0100.01216.73
7.4.110.0120.00616.70
7.4.100.0100.00616.80
7.4.90.0090.01216.70
7.4.80.0090.01019.39
7.4.70.0110.01116.64
7.4.60.0130.00316.78
7.4.50.0090.00316.63
7.4.40.0120.00616.72
7.4.00.0050.01415.10
7.3.330.0000.00613.47
7.3.320.0000.00513.26
7.3.310.0030.00316.44
7.3.300.0000.00616.52
7.3.290.0050.00216.38
7.3.280.0040.01116.58
7.3.260.0110.00916.74
7.3.240.0080.00916.64
7.3.230.0140.00316.67
7.3.210.0110.01116.71
7.3.200.0180.00616.63
7.3.190.0130.00716.45
7.3.180.0090.00616.67
7.3.170.0060.01116.52
7.3.160.0110.00516.57
7.3.120.0090.00915.01
7.3.110.0030.01314.95
7.3.100.0030.01614.57
7.3.90.0070.01014.88
7.3.80.0080.00014.91
7.3.70.0040.00815.00
7.3.60.0030.01014.75
7.3.50.0000.01014.61
7.3.40.0030.01315.05
7.3.30.0050.00514.72
7.3.20.0100.00316.60
7.3.10.0050.00516.71
7.3.00.0040.00916.57
7.2.330.0070.01016.88
7.2.320.0110.00816.86
7.2.310.0180.00716.72
7.2.300.0070.01016.73
7.2.290.0100.00916.92
7.2.250.0130.00715.15
7.2.240.0030.01615.21
7.2.230.0090.00915.09
7.2.220.0030.00715.23
7.2.210.0040.00415.10
7.2.200.0080.00315.26
7.2.190.0000.01415.29
7.2.180.0000.01215.06
7.2.170.0040.01115.27
7.2.130.0040.00816.89
7.2.120.0060.00916.84
7.2.110.0090.00016.91
7.2.100.0080.00417.03
7.2.90.0090.00616.80
7.2.80.0070.01017.08
7.2.70.0080.00416.95
7.2.60.0340.00416.05
7.2.50.0210.00715.95
7.2.40.0200.00815.86
7.2.30.0240.00515.94
7.2.20.0190.00915.99
7.2.10.0220.00315.93
7.2.00.0220.00715.97
7.1.330.0070.00715.70
7.1.320.0040.00415.92
7.1.310.0080.00415.96
7.1.300.0110.00415.83
7.1.290.0000.01115.85
7.1.280.0030.00615.75
7.1.270.0040.01115.75
7.1.260.0040.01115.86
7.1.250.0030.00815.86
7.1.200.0110.00316.12
7.1.170.0340.00913.52
7.1.160.0350.01013.43
7.1.150.0400.00313.65
7.1.140.0350.00614.17
7.1.130.0330.01313.79
7.1.120.0320.01013.79
7.1.110.0560.00413.84
7.1.100.0610.00613.71
7.1.90.0550.01213.65
7.1.80.0510.00713.86
7.1.70.0430.01013.54
7.1.60.0650.00631.77
7.1.50.0660.00731.59
7.1.40.0730.00031.82
7.1.30.0700.00731.69
7.1.20.0610.01131.63
7.1.10.0840.01113.60
7.1.00.0360.01014.04

preferences:
41.49 ms | 401 KiB | 5 Q