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->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.1.70.0030.00317.62
8.1.60.0040.00417.86
8.1.50.0040.00417.73
8.1.40.0000.00817.77
8.1.30.0040.00417.96
8.1.20.0040.00417.78
8.1.10.0000.00717.77
8.1.00.0040.00417.75
8.0.200.0000.00717.14
8.0.190.0040.00417.04
8.0.180.0040.00417.02
8.0.170.0040.00417.00
8.0.160.0070.00017.02
8.0.150.0030.00517.02
8.0.140.0070.00317.13
8.0.130.0060.00013.50
8.0.120.0000.00717.14
8.0.110.0050.00217.21
8.0.100.0050.00217.14
8.0.90.0050.00317.11
8.0.80.0040.01117.23
8.0.70.0000.00716.95
8.0.60.0000.00816.95
8.0.50.0040.00416.85
8.0.30.0080.01017.25
8.0.20.0150.00417.40
8.0.10.0040.00417.09
8.0.00.0110.00716.88
7.4.300.0030.00316.72
7.4.290.0000.00816.74
7.4.280.0000.00816.60
7.4.270.0000.00816.69
7.4.260.0040.00413.43
7.4.250.0040.00416.72
7.4.240.0040.00416.75
7.4.230.0070.00016.82
7.4.220.0110.00716.81
7.4.210.0080.00616.71
7.4.200.0030.00316.73
7.4.190.0070.00016.86
7.4.160.0120.00416.79
7.4.150.0150.00317.40
7.4.140.0130.00417.86
7.4.130.0090.01116.84
7.4.120.0110.00616.75
7.4.110.0110.00816.57
7.4.100.0140.00916.67
7.4.90.0060.01216.59
7.4.80.0110.00717.79
7.4.70.0130.00616.58
7.4.60.0120.01016.53
7.4.50.0070.00516.74
7.4.40.0070.00919.42
7.4.30.0130.00716.69
7.4.20.0150.00916.55
7.4.10.0160.00816.79
7.4.00.0100.00615.57
7.3.330.0060.00013.20
7.3.320.0000.00513.34
7.3.310.0070.00016.50
7.3.300.0030.00516.48
7.3.290.0030.01016.47
7.3.280.0080.00816.49
7.3.270.0110.00717.40
7.3.260.0110.01118.24
7.3.250.0110.00716.58
7.3.240.0110.00516.51
7.3.230.0120.00916.57
7.3.220.0130.00816.79
7.3.210.0070.01016.67
7.3.200.0140.00817.99
7.3.190.0090.01116.52
7.3.180.0140.00516.76
7.3.170.0070.01116.48
7.3.160.0060.01316.49
7.3.150.0080.01216.48
7.3.140.0070.01716.54
7.3.130.0100.00716.74
7.3.120.0090.00615.42
7.3.110.0060.01215.59
7.3.100.0060.01016.02
7.3.90.0050.01315.70
7.3.80.0070.01015.60
7.3.70.0070.01415.76
7.3.60.0090.00715.70
7.3.50.0090.00915.66
7.3.40.0110.00715.42
7.3.30.0120.00415.65
7.3.20.0060.01016.67
7.3.10.0070.01216.46
7.3.00.0080.01116.65
7.2.340.0100.01016.90
7.2.330.0050.01617.03
7.2.320.0090.01116.91
7.2.310.0100.01116.88
7.2.300.0110.00816.98
7.2.290.0100.00816.76
7.2.280.0110.01116.90
7.2.270.0120.01216.99
7.2.260.0040.02116.89
7.2.250.0110.00916.18
7.2.240.0110.00916.00
7.2.230.0110.00615.97
7.2.220.0030.01215.80
7.2.210.0120.00616.09
7.2.200.0090.00516.03
7.2.190.0090.00716.00
7.2.180.0100.00915.88
7.2.170.0050.01216.00
7.2.160.0100.01016.87
7.2.150.0060.02217.02
7.2.140.0200.00716.84
7.2.130.0120.00716.87
7.2.120.0150.00816.79
7.2.110.0160.00616.70
7.2.100.0130.00716.59
7.2.90.0100.00716.93
7.2.80.0190.00316.94
7.2.70.0110.01316.67
7.2.60.0090.01117.02
7.2.50.0130.00916.67
7.2.40.0130.00916.83
7.2.30.0140.00716.96
7.2.20.0120.00916.66
7.2.10.0120.01016.84
7.2.00.0170.00417.90
7.1.330.0060.01115.73
7.1.320.0080.01015.71
7.1.310.0060.01315.91
7.1.300.0090.00915.74
7.1.290.0080.01015.93
7.1.280.0040.01415.90
7.1.270.0090.00815.80
7.1.260.0040.01116.01
7.1.250.0080.01115.55
7.1.240.0130.00815.61
7.1.230.0100.00715.71
7.1.220.0110.01115.69
7.1.210.0050.01415.63
7.1.200.0090.00915.82
7.1.190.0070.01015.71
7.1.180.0110.00715.98
7.1.170.0070.01015.54
7.1.160.0050.01915.59
7.1.150.0190.00415.88
7.1.140.0030.01315.76
7.1.130.0070.01015.72
7.1.120.0130.00315.78
7.1.110.0110.00615.88
7.1.100.0340.00615.69
7.1.90.0090.00915.73
7.1.80.0120.00715.75
7.1.70.0090.00416.50
7.1.60.0100.00617.57
7.1.50.0060.01316.39
7.1.40.0160.00415.89
7.1.30.0070.01115.79
7.1.20.0100.00715.64
7.1.10.0120.00615.58
7.1.00.0170.02919.02
7.0.330.0040.01415.50
7.0.320.0080.00815.47
7.0.310.0110.01115.34
7.0.300.0130.00715.45
7.0.290.0160.01015.24
7.0.280.0070.01415.39
7.0.270.0070.01515.39
7.0.260.0110.01115.39
7.0.250.0030.01315.52
7.0.240.0060.01215.58
7.0.230.0140.00315.45
7.0.220.0080.01115.25
7.0.210.0040.01215.48
7.0.200.0030.01016.09
7.0.190.0120.00915.48
7.0.180.0030.01315.48
7.0.170.0070.01015.43
7.0.160.0130.00615.26
7.0.150.0140.00415.23
7.0.140.0080.04018.85
7.0.130.0150.00315.32
7.0.120.0100.00715.41
7.0.110.0040.01115.38
7.0.100.0140.00315.48
7.0.90.0060.01215.36
7.0.80.0040.01415.37
7.0.70.0100.00715.67
7.0.60.0040.02118.56
7.0.50.0020.05016.61
7.0.40.0030.02917.78
7.0.30.0200.03017.86
7.0.20.0150.04517.82
7.0.10.0090.04517.80
7.0.00.0090.02417.80
5.6.400.0110.01416.31
5.6.390.0170.00716.29
5.6.380.0060.01616.35
5.6.370.0120.01015.92
5.6.360.0120.01016.27
5.6.350.0100.01216.33
5.6.340.0130.00716.30
5.6.330.0150.00915.98
5.6.320.0130.00816.29
5.6.310.0100.01116.27
5.6.300.0060.01416.06
5.6.290.0070.01216.15
5.6.280.0030.04418.57
5.6.270.0130.01316.29
5.6.260.0100.00816.27
5.6.250.0030.01715.96
5.6.240.0070.01316.25
5.6.230.0070.01516.04
5.6.220.0120.00616.29
5.6.210.0110.02118.47
5.6.200.0150.02917.27
5.6.190.0070.02918.58
5.6.180.0270.03518.44
5.6.170.0190.02418.57
5.6.160.0100.04818.25
5.6.150.0090.02317.26
5.6.140.0100.03417.13
5.6.130.0080.04717.21
5.6.120.0190.03018.63
5.6.110.0110.03618.71
5.6.100.0070.04018.60
5.6.90.0110.04518.71
5.6.80.0110.04318.19
5.6.70.0110.00815.89
5.6.60.0110.01415.95
5.6.50.0130.01316.08
5.6.40.0080.01416.26
5.6.30.0110.01516.00
5.6.20.0050.01816.09
5.6.10.0090.00916.13
5.6.00.0030.01416.15
5.5.380.0230.00616.00
5.5.370.0170.01116.01
5.5.360.0290.00315.84
5.5.350.0190.03118.20
5.5.340.0120.04717.26
5.5.330.0200.04318.16
5.5.320.0120.04818.31
5.5.310.0240.04918.26
5.5.300.0170.03317.13
5.5.290.0110.03517.01
5.5.280.0150.02618.58
5.5.270.0110.03018.57
5.5.260.0150.05318.61
5.5.250.0160.03218.33
5.5.240.0150.04518.19
5.5.230.0250.00915.73
5.5.220.0270.01116.00
5.5.210.0150.01615.98
5.5.200.0260.00315.87
5.5.190.0210.00916.15
5.5.180.0200.01016.12
5.5.170.0190.01416.16
5.5.160.0210.00916.00
5.5.150.0240.01416.11
5.5.140.0230.01016.30
5.5.130.0170.01416.09
5.5.120.0240.01216.20
5.5.110.0230.01415.84
5.5.100.0240.01215.99
5.5.90.0140.01415.95
5.5.80.0200.01216.03
5.5.70.0340.00016.09
5.5.60.0090.02215.81
5.5.50.0190.01215.70
5.5.40.0210.01515.88
5.5.30.0240.00615.66
5.5.20.0280.01216.12
5.5.10.0190.00916.09
5.5.00.0190.01115.97
5.4.450.0220.02816.14
5.4.440.0200.03116.19
5.4.430.0220.04016.18
5.4.420.0180.04116.17
5.4.410.0220.02416.15
5.4.400.0260.03815.99
5.4.390.0240.03815.96
5.4.380.0270.03716.07
5.4.370.0180.02716.03
5.4.360.0230.02315.88
5.4.350.0300.03315.97
5.4.340.0280.02916.02
5.4.330.0130.00912.80
5.4.320.0260.03616.06
5.4.310.0250.04015.95
5.4.300.0220.02016.00
5.4.290.0260.03816.15
5.4.280.0220.02315.80
5.4.270.0260.03716.04
5.4.260.0200.02315.96
5.4.250.0220.03615.91
5.4.240.0230.02215.98
5.4.230.0270.03316.07
5.4.220.0200.04015.94
5.4.210.0230.04116.01
5.4.200.0200.03616.04
5.4.190.0190.03815.91
5.4.180.0210.03116.01
5.4.170.0150.02815.87
5.4.160.0290.03715.96
5.4.150.0210.03416.00
5.4.140.0270.03314.52
5.4.130.0270.02214.58
5.4.120.0170.03214.77
5.4.110.0200.03714.70
5.4.100.0280.03114.54
5.4.90.0230.02614.59
5.4.80.0150.03214.64
5.4.70.0230.04214.70
5.4.60.0240.01914.74
5.4.50.0240.02014.75
5.4.40.0220.02814.62
5.4.30.0210.03214.67
5.4.20.0200.02214.70
5.4.10.0220.03514.66
5.4.00.0200.02514.42
5.3.290.0170.02513.87
5.3.280.0180.02713.92
5.3.270.0190.02213.99
5.3.260.0180.02714.00
5.3.250.0320.03213.95
5.3.240.0240.02213.88
5.3.230.0250.03313.93
5.3.220.0220.03513.85
5.3.210.0230.03813.81
5.3.200.0310.03313.88
5.3.190.0190.03613.86
5.3.180.0220.02614.09
5.3.170.0300.02814.09
5.3.160.0240.02114.00
5.3.150.0200.03814.09
5.3.140.0180.04213.97
5.3.130.0170.03713.87
5.3.120.0160.02813.83
5.3.110.0200.02913.85
5.3.100.0220.03113.58
5.3.90.0270.03413.78
5.3.80.0280.02013.65
5.3.70.0180.02513.50
5.3.60.0240.02313.62
5.3.50.0260.03113.59
5.3.40.0180.03613.60
5.3.30.0260.03013.58
5.3.20.0190.02613.41
5.3.10.0160.04113.27
5.3.00.0180.02813.29

preferences:
119.75 ms | 406 KiB | 5 Q