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"/> <yt:duration seconds="1875"/> </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->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.0130.01017.00
8.3.50.0130.00521.26
8.3.40.0070.00719.00
8.3.30.0110.00319.09
8.3.20.0050.00319.02
8.3.10.0040.00421.32
8.3.00.0040.00723.96
8.2.180.0030.01316.75
8.2.170.0110.00722.96
8.2.160.0030.01020.65
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0040.00421.19
8.2.110.0060.00320.78
8.2.100.0060.00817.97
8.2.90.0000.00819.42
8.2.80.0000.00918.28
8.2.70.0060.00317.75
8.2.60.0000.00818.16
8.2.50.0060.00318.07
8.2.40.0050.00318.41
8.2.30.0040.00420.18
8.2.20.0040.00417.83
8.2.10.0040.00417.86
8.2.00.0070.00317.97
8.1.280.0120.00625.92
8.1.270.0040.00423.99
8.1.260.0060.00826.35
8.1.250.0000.00728.09
8.1.240.0090.00024.02
8.1.230.0030.00921.04
8.1.220.0080.00018.77
8.1.210.0030.00819.22
8.1.200.0030.00617.48
8.1.190.0030.00617.64
8.1.180.0000.01118.10
8.1.170.0040.00418.76
8.1.160.0020.00519.06
8.1.150.0070.00018.81
8.1.140.0040.00417.73
8.1.130.0030.00318.04
8.1.120.0050.00317.75
8.1.110.0040.00417.56
8.1.100.0000.00717.69
8.1.90.0030.00617.62
8.1.80.0030.00317.71
8.1.70.0000.00717.68
8.1.60.0040.00417.70
8.1.50.0040.00417.57
8.1.40.0000.00817.82
8.1.30.0040.00417.95
8.1.20.0030.00617.83
8.1.10.0040.00417.66
8.1.00.0070.00017.75
8.0.300.0060.00320.02
8.0.290.0000.00818.86
8.0.280.0030.00318.61
8.0.270.0080.00017.41
8.0.260.0000.00817.10
8.0.250.0040.00417.19
8.0.240.0040.00417.23
8.0.230.0000.00717.07
8.0.220.0030.00517.17
8.0.210.0030.00317.12
8.0.200.0030.00317.18
8.0.190.0000.00717.23
8.0.180.0060.00317.08
8.0.170.0030.00617.00
8.0.160.0030.00317.04
8.0.150.0000.00817.00
8.0.140.0050.00217.08
8.0.130.0000.00513.57
8.0.120.0000.00817.07
8.0.110.0050.00317.00
8.0.100.0040.00416.93
8.0.90.0040.00417.12
8.0.80.0060.01117.07
8.0.70.0040.00416.85
8.0.60.0040.00417.00
8.0.50.0020.00517.13
8.0.30.0130.00717.42
8.0.20.0120.00617.42
8.0.10.0040.00417.12
8.0.00.0150.00616.83
7.4.330.0050.00014.92
7.4.320.0030.00316.64
7.4.300.0030.00316.65
7.4.290.0070.00016.73
7.4.280.0040.00416.85
7.4.270.0000.00916.61
7.4.260.0050.00013.46
7.4.250.0040.00416.67
7.4.240.0030.00316.73
7.4.230.0030.00316.87
7.4.220.0060.00916.68
7.4.210.0100.00516.70
7.4.200.0000.00716.72
7.4.190.0030.00316.83
7.4.160.0100.01016.70
7.4.150.0100.00917.40
7.4.140.0090.00917.86
7.4.130.0120.00516.72
7.4.120.0060.01216.58
7.4.110.0090.00916.70
7.4.100.0090.00916.89
7.4.90.0130.00716.53
7.4.80.0040.01519.37
7.4.70.0080.00816.48
7.4.60.0040.01216.70
7.4.50.0040.00416.43
7.4.40.0060.01022.27
7.4.30.0080.00916.67
7.4.00.0100.00715.11
7.3.330.0050.00013.29
7.3.320.0040.00313.16
7.3.310.0000.00716.28
7.3.300.0080.00016.47
7.3.290.0040.01016.48
7.3.280.0070.00916.48
7.3.270.0170.00317.40
7.3.260.0070.01318.24
7.3.250.0130.00516.56
7.3.240.0030.01216.77
7.3.230.0060.01116.75
7.3.210.0160.00316.51
7.3.200.0140.00719.39
7.3.190.0080.01516.50
7.3.180.0130.00716.38
7.3.170.0160.00616.41
7.3.160.0120.01116.68
7.3.120.0030.01514.76
7.3.110.0030.01414.76
7.3.100.0000.01614.77
7.3.90.0040.00415.01
7.3.80.0030.01415.08
7.3.70.0030.00615.10
7.3.60.0030.01315.00
7.3.50.0140.00314.70
7.3.40.0030.01315.05
7.3.30.0070.00714.92
7.3.20.0120.00316.86
7.3.10.0110.00616.66
7.3.00.0070.00716.72
7.2.330.0110.00616.79
7.2.320.0120.00916.93
7.2.310.0060.01616.97
7.2.300.0080.01617.00
7.2.290.0060.01516.66
7.2.250.0130.00615.41
7.2.240.0040.01415.20
7.2.230.0060.00915.16
7.2.220.0090.00415.27
7.2.210.0040.00814.80
7.2.200.0060.00315.20
7.2.190.0000.01715.21
7.2.180.0110.00015.37
7.2.170.0080.00315.30
7.2.130.0120.00816.66
7.2.120.0140.00417.12
7.2.110.0170.00017.04
7.2.100.0200.00316.95
7.2.90.0110.01116.88
7.2.80.0140.00716.89
7.2.70.0090.01316.77
7.2.60.0100.01316.80
7.2.50.0200.01017.10
7.2.40.0190.01116.95
7.2.30.0250.01116.97
7.2.20.0210.01217.25
7.2.10.0210.00716.98
7.2.00.0110.00618.29
7.1.330.0040.01115.80
7.1.320.0120.00415.77
7.1.310.0060.00915.77
7.1.300.0110.00415.98
7.1.290.0080.00415.58
7.1.280.0050.00816.10
7.1.270.0040.01115.69
7.1.260.0030.01015.60
7.1.250.0170.00315.39
7.1.240.0150.00315.66
7.1.230.0070.01415.50
7.1.220.0090.01215.64
7.1.210.0120.00815.59
7.1.200.0100.00815.70
7.1.190.0230.00415.94
7.1.180.0220.00915.93
7.1.170.0200.01015.91
7.1.160.0200.00815.74
7.1.150.0150.01515.68
7.1.140.0210.01415.79
7.1.130.0170.01315.98
7.1.120.0230.00415.98
7.1.110.0170.01215.92
7.1.100.0140.00716.88
7.1.90.0240.00815.79
7.1.80.0310.00315.63
7.1.70.0130.00616.56
7.1.60.0190.00517.63
7.1.50.0130.01216.27
7.1.40.0130.00715.81
7.1.30.0170.00415.93
7.1.20.0200.01015.93
7.1.10.0130.01615.88
7.1.00.0100.02019.03
7.0.330.0120.00815.10
7.0.320.0150.00415.27
7.0.310.0160.01015.20
7.0.300.0200.00615.44
7.0.290.0190.00715.37
7.0.280.0140.01315.46
7.0.270.0130.01015.38
7.0.260.0170.00415.46
7.0.250.0220.00815.48
7.0.240.0190.00515.49
7.0.230.0210.01015.47
7.0.220.0190.01215.71
7.0.210.0230.00715.69
7.0.200.0160.00316.10
7.0.190.0230.01015.51
7.0.180.0220.00815.35
7.0.170.0230.01015.66
7.0.160.0120.00915.47
7.0.150.0160.01015.46
7.0.140.0080.03918.78
7.0.130.0170.00915.20
7.0.120.0130.00315.60
7.0.110.0120.00615.36
7.0.100.0060.00915.18
7.0.90.0130.00315.48
7.0.80.0120.00615.65
7.0.70.0060.04518.66
7.0.60.0060.02918.60
7.0.50.0100.02718.76
7.0.40.0060.01816.89
7.0.30.0030.02116.79
7.0.20.0020.05016.88
7.0.10.0060.04216.82
7.0.00.0020.04416.81
5.6.380.0070.00714.39
5.6.370.0000.01214.52
5.6.360.0070.01014.53
5.6.350.0100.00714.47
5.6.340.0170.00614.34
5.6.330.0060.01414.63
5.6.320.0080.00814.52
5.6.310.0200.00714.50
5.6.300.0040.01814.32
5.6.290.0030.01014.79
5.6.280.0070.03817.88
5.6.270.0060.00614.53
5.6.260.0040.01214.60
5.6.250.0080.00414.65
5.6.240.0100.00314.36
5.6.230.0000.00814.40
5.6.220.0090.02517.38
5.6.210.0050.04617.59
5.6.200.0070.04517.75
5.6.190.0050.04317.77
5.6.180.0030.02217.74
5.6.170.0060.03617.80
5.6.160.0060.03617.76
5.6.150.0140.04017.63
5.6.140.0080.04317.66
5.6.130.0070.04317.76
5.6.120.0080.03717.96
5.6.110.0050.03717.75
5.6.100.0020.03517.66
5.6.90.0170.03817.84
5.6.80.0100.04017.47
5.6.70.0070.02917.48
5.6.60.0060.03817.42
5.6.50.0070.02517.26
5.6.40.0070.03817.34
5.6.30.0130.03817.30
5.6.20.0020.04517.51
5.6.10.0060.04017.41
5.6.00.0070.04317.57
5.5.380.0040.00410.82
5.5.370.0060.00311.06
5.5.360.0040.04515.86
5.5.350.0050.02715.93
5.5.340.0000.04215.94
5.5.330.0030.04716.03
5.5.320.0050.03816.14
5.5.310.0050.04415.84
5.5.300.0070.03416.03
5.5.290.0050.03216.08
5.5.280.0030.03616.06
5.5.270.0060.03315.91
5.5.260.0070.03815.92
5.5.250.0010.04415.84
5.5.240.0030.02815.76
5.5.230.0020.02715.71
5.5.220.0030.03315.70
5.5.210.0020.03815.62
5.5.200.0070.03515.55
5.5.190.0030.04415.87
5.5.180.0050.04115.75
5.5.170.0000.00811.21
5.5.160.0000.03415.75
5.5.150.0020.04215.59
5.5.140.0030.02915.73
5.5.130.0050.03915.77
5.5.120.0060.03815.54
5.5.110.0030.04315.65
5.5.100.0080.03515.64
5.5.90.0030.02615.55
5.5.80.0080.01815.54
5.5.70.0050.04215.60
5.5.60.0060.04215.58
5.5.50.0040.04215.77
5.5.40.0070.02515.71
5.5.30.0050.02615.63
5.5.20.0060.02115.65
5.5.10.0050.04515.64
5.5.00.0050.02615.68
5.4.450.0030.04115.12
5.4.440.0090.03515.16
5.4.430.0030.02715.33
5.4.420.0060.02115.35
5.4.410.0060.03815.23
5.4.400.0040.03015.03
5.4.390.0040.03915.12
5.4.380.0020.04015.11
5.4.370.0080.03815.06
5.4.360.0020.04415.16
5.4.350.0000.03615.19
5.4.340.0030.03815.14
5.4.330.0060.00610.93
5.4.320.0020.04115.09
5.4.310.0070.03015.01
5.4.300.0090.03615.04
5.4.290.0060.03815.01
5.4.280.0020.04215.37
5.4.270.0030.04215.09
5.4.260.0020.03815.11
5.4.250.0030.02815.04
5.4.240.0030.03314.89
5.4.230.0080.03814.98
5.4.220.0020.04315.07
5.4.210.0070.03814.97
5.4.200.0030.04315.11
5.4.190.0020.03915.22
5.4.180.0030.03115.17
5.4.170.0020.03515.21
5.4.160.0020.04015.10
5.4.150.0030.03115.13
5.4.140.0020.04413.76
5.4.130.0010.04113.74
5.4.120.0060.03513.79
5.4.110.0030.04313.68
5.4.100.0040.03013.63
5.4.90.0060.03813.84
5.4.80.0030.04313.61
5.4.70.0050.03813.65
5.4.60.0090.03513.56
5.4.50.0040.03013.73
5.4.40.0030.02813.70
5.4.30.0050.03813.75
5.4.20.0040.03913.91
5.4.10.0030.02413.88
5.4.00.0040.03013.40
5.3.290.0020.04312.52
5.3.280.0020.02712.58
5.3.270.0020.02912.62
5.3.260.0020.04412.59
5.3.250.0040.04112.67
5.3.240.0030.02312.59
5.3.230.0030.03012.46
5.3.220.0050.02012.60
5.3.210.0030.02612.50
5.3.200.0040.03712.48
5.3.190.0030.02512.55
5.3.180.0050.04012.72
5.3.170.0070.04012.65
5.3.160.0080.03712.61
5.3.150.0030.03812.59
5.3.140.0030.04112.51
5.3.130.0030.02812.58
5.3.120.0040.02412.42
5.3.110.0060.04212.62
5.3.100.0040.04112.41
5.3.90.0030.03812.15
5.3.80.0040.03912.24
5.3.70.0030.04212.13
5.3.60.0040.03912.18
5.3.50.0080.03612.17
5.3.40.0020.04312.21
5.3.30.0050.03412.21
5.3.20.0030.03612.07
5.3.10.0020.02911.88
5.3.00.0020.02911.98
5.2.170.0030.03511.10
5.2.160.0000.03711.10
5.2.150.0030.03411.10
5.2.140.0050.03211.10
5.2.130.0030.02011.10
5.2.120.0020.01711.10
5.2.110.0040.02611.10
5.2.100.0020.02511.10
5.2.90.0030.03211.10
5.2.80.0030.01611.10
5.2.70.0000.01811.10
5.2.60.0020.01711.10
5.2.50.0040.03211.10
5.2.40.0020.03211.10
5.2.30.0060.03011.10
5.2.20.0030.03311.10
5.2.10.0000.03411.10
5.2.00.0000.03211.10
5.1.60.0010.02811.10
5.1.50.0080.02311.10
5.1.40.0030.01611.10
5.1.30.0020.01511.10
5.1.20.0020.01511.10
5.1.10.0040.01811.10
5.1.00.0020.02911.10
5.0.50.0000.02211.10
5.0.40.0050.01211.10
5.0.30.0030.03211.10
5.0.20.0080.02011.10
5.0.10.0050.01711.10
5.0.00.0030.03111.10
4.4.90.0010.01011.10
4.4.80.0030.00711.10
4.4.70.0020.01811.10
4.4.60.0020.01311.10
4.4.50.0010.02111.10
4.4.40.0030.02411.10
4.4.30.0000.01311.10
4.4.20.0010.01811.10
4.4.10.0060.01311.10
4.4.00.0030.02711.10
4.3.110.0050.01611.10
4.3.100.0000.01411.10
4.3.90.0020.01511.10
4.3.80.0020.02811.10
4.3.70.0040.01311.10
4.3.60.0020.02011.10
4.3.50.0020.01511.10
4.3.40.0030.02711.10
4.3.30.0020.01411.10
4.3.20.0020.02611.10
4.3.10.0050.01511.10
4.3.00.0020.02011.10

preferences:
52.95 ms | 400 KiB | 5 Q