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:seconds="0 in yt namespace" /> </entry> </feed>'; $xml = new SimpleXMLElement($buffer); if (!defined('LIBXML_DOTTED_VERSION')) { echo "PHP/LIBXML unsupported/too old."; return; } echo "ibxml version: ", LIBXML_DOTTED_VERSION, "\n"; $youtube = $xml; echo 'via attributes(): ', $youtube->entry->children('yt')->duration->attributes()->seconds, "\n"; echo 'via array-access: ', $youtube->entry->children('yt')->duration['seconds'], "\n"; echo 'via property : ', $youtube->entry->children('yt')->duration->seconds, "\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.0070.00719.09
8.3.30.0150.00719.34
8.3.20.0040.00420.59
8.3.10.0060.00320.82
8.3.00.0050.00319.63
8.2.170.0110.00322.96
8.2.160.0100.00320.64
8.2.150.0060.00324.18
8.2.140.0060.00324.66
8.2.130.0070.00026.16
8.2.120.0000.00822.48
8.2.110.0060.00322.27
8.2.100.0070.00718.03
8.2.90.0040.00419.47
8.2.80.0030.00617.97
8.2.70.0060.00318.00
8.2.60.0060.00318.18
8.2.50.0060.00618.07
8.2.40.0080.00018.40
8.2.30.0000.00819.73
8.2.20.0040.00418.04
8.2.10.0040.00418.29
8.2.00.0000.00817.98
8.1.270.0090.00022.32
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0000.00924.09
8.1.230.0080.00319.36
8.1.220.0030.00518.04
8.1.210.0040.00418.77
8.1.200.0100.00017.48
8.1.190.0040.00417.35
8.1.180.0040.00418.10
8.1.170.0090.00018.78
8.1.160.0040.00422.28
8.1.150.0070.00018.98
8.1.140.0000.00717.50
8.1.130.0030.00318.08
8.1.120.0040.00417.63
8.1.110.0040.00417.50
8.1.100.0050.00217.67
8.1.90.0030.00317.51
8.1.80.0000.00817.59
8.1.70.0040.00417.62
8.1.60.0060.00317.67
8.1.50.0050.00317.57
8.1.40.0060.00317.55
8.1.30.0000.00817.67
8.1.20.0070.00017.74
8.1.10.0050.00317.78
8.1.00.0050.00317.59
8.0.300.0030.00618.77
8.0.290.0040.00417.00
8.0.280.0000.00718.72
8.0.270.0040.00417.36
8.0.260.0070.00017.44
8.0.250.0000.00617.14
8.0.240.0000.00717.07
8.0.230.0000.00717.23
8.0.220.0000.00717.04
8.0.210.0030.00317.16
8.0.200.0000.00717.24
8.0.190.0030.00317.24
8.0.180.0080.00017.23
8.0.170.0050.00317.21
8.0.160.0030.00317.15
8.0.150.0070.00017.14
8.0.140.0000.00717.08
8.0.130.0040.00413.63
8.0.120.0000.00816.97
8.0.110.0000.00717.15
8.0.100.0040.00417.13
8.0.90.0000.00717.15
8.0.80.0030.01317.14
8.0.70.0040.00417.15
8.0.60.0070.00017.04
8.0.50.0030.00516.91
8.0.30.0120.00817.38
8.0.20.0080.01217.40
8.0.10.0050.00217.34
8.0.00.0090.00816.89
7.4.330.0050.00015.29
7.4.320.0000.00716.75
7.4.300.0000.00716.64
7.4.290.0000.00716.81
7.4.280.0000.00716.82
7.4.270.0000.00816.74
7.4.260.0030.00316.67
7.4.250.0040.00416.75
7.4.240.0030.00316.78
7.4.230.0050.00216.75
7.4.220.0110.00616.82
7.4.210.0120.00616.85
7.4.200.0000.00716.77
7.4.160.0040.01616.51
7.4.150.0090.00917.40
7.4.140.0100.00917.86
7.4.130.0060.01116.82
7.4.120.0110.01116.73
7.4.110.0040.01316.74
7.4.100.0110.00616.81
7.4.90.0070.01116.80
7.4.80.0100.01119.39
7.4.70.0130.00416.80
7.4.60.0160.00616.82
7.4.50.0000.00816.77
7.4.40.0080.00816.85
7.4.30.0000.01816.75
7.4.00.0000.01515.13
7.3.330.0000.00713.35
7.3.320.0030.00313.28
7.3.310.0070.00016.31
7.3.300.0030.00316.35
7.3.290.0140.00016.47
7.3.280.0090.01016.49
7.3.270.0030.02017.40
7.3.260.0140.00416.71
7.3.250.0140.00416.60
7.3.240.0040.01216.63
7.3.230.0140.00316.78
7.3.210.0120.00616.57
7.3.200.0040.01519.39
7.3.190.0060.01416.88
7.3.180.0060.00916.55
7.3.170.0120.00916.64
7.3.160.0150.00016.64
7.3.00.0000.01216.68
7.2.330.0070.01116.94
7.2.320.0070.01316.63
7.2.310.0080.00816.80
7.2.300.0080.01216.43
7.2.290.0080.01216.98
7.2.130.0040.01116.85
7.2.120.0040.00416.86
7.2.110.0000.01816.70
7.2.100.0060.00616.72
7.2.90.0100.00317.08
7.2.80.0080.00616.66
7.2.70.0140.00017.04
7.2.60.0100.00616.83
7.2.50.0070.00717.04
7.2.40.0060.00816.95
7.2.30.0090.00616.92
7.2.20.0000.01216.88
7.2.10.0030.01016.52
7.2.00.0070.00718.33
7.1.250.0030.00915.66
7.1.240.0030.01015.78
7.1.230.0100.00315.81
7.1.220.0060.01015.91
7.1.210.0100.00715.47
7.1.200.0090.00215.90
7.1.190.0100.00315.79
7.1.180.0000.01015.61
7.1.170.0030.00615.62
7.1.160.0070.00315.74
7.1.150.0030.00615.91
7.1.140.0060.00915.84
7.1.130.0070.00415.62
7.1.120.0060.00615.74
7.1.110.0030.01015.96
7.1.100.0000.01217.12
7.1.90.0000.01016.16
7.1.80.0130.00315.85
7.1.70.0040.00816.43
7.1.60.0100.00617.42
7.1.50.0020.01616.46
7.1.40.0030.00915.68
7.1.30.0030.01015.55
7.1.20.0040.01115.75
7.1.10.0060.00915.91
7.1.00.0080.03619.10
7.0.330.0050.00315.32
7.0.320.0000.01315.34
7.0.310.0150.00315.37
7.0.300.0060.00615.36
7.0.290.0030.01015.57
7.0.280.0060.00915.20
7.0.270.0040.00815.47
7.0.260.0120.00315.54
7.0.250.0060.00915.53
7.0.240.0120.00015.11
7.0.230.0030.01015.52
7.0.220.0000.01115.51
7.0.210.0110.00415.56
7.0.200.0060.00516.00
7.0.190.0000.01515.45
7.0.180.0070.00715.48
7.0.170.0120.00315.55
7.0.160.0070.00415.49
7.0.150.0070.00715.38
7.0.140.0010.03618.71
7.0.130.0030.00715.72
7.0.120.0100.00715.42
7.0.110.0030.01015.44
7.0.100.0070.00715.38
7.0.90.0090.00315.57
7.0.80.0000.01415.30
7.0.70.0100.00315.52
7.0.60.0080.04117.62
7.0.50.0070.03516.62
7.0.40.0030.03816.84
7.0.30.0160.04116.89
7.0.20.0100.03516.90
7.0.10.0060.02816.69
7.0.00.0080.02816.94
5.6.380.0040.01114.41
5.6.370.0070.00714.23
5.6.360.0080.00814.18
5.6.350.0090.00314.35
5.6.340.0050.00514.22
5.6.330.0080.00014.43
5.6.320.0030.00513.99
5.6.310.0040.00714.25
5.6.300.0000.01214.64
5.6.290.0090.00614.29
5.6.280.0060.03817.68
5.6.270.0060.00914.71
5.6.260.0060.00614.22
5.6.250.0060.00614.21
5.6.240.0110.00614.57
5.6.230.0000.01114.29
5.6.220.0060.00614.38
5.6.210.0070.04117.46
5.6.200.0030.04516.26
5.6.190.0100.03517.51
5.6.180.0170.02217.57
5.6.170.0120.02917.35
5.6.160.0090.02517.57
5.6.150.0070.03716.29
5.6.140.0050.03016.34
5.6.130.0070.04516.22
5.6.120.0050.02117.88
5.6.110.0070.04217.73
5.6.100.0050.02617.90
5.6.90.0090.03817.57
5.6.80.0000.02717.42
5.6.70.0140.00014.24
5.6.60.0080.00314.57
5.6.50.0030.01214.35
5.6.40.0040.00814.28
5.6.30.0130.00014.17
5.6.20.0050.00514.36
5.6.10.0110.00414.23
5.6.00.0060.00314.45
5.5.380.0070.00011.18
5.5.370.0120.00011.18
5.5.360.0060.00611.18
5.5.350.2120.02615.78
5.5.340.0120.03714.60
5.5.330.0060.02315.72
5.5.320.0220.03715.76
5.5.310.0130.04115.80
5.5.300.0050.03314.63
5.5.290.0020.02614.75
5.5.280.0100.02716.06
5.5.270.0100.04015.99
5.5.260.0100.03916.11
5.5.250.0080.03015.96
5.5.240.0000.04315.69
5.5.230.0080.00311.18
5.5.220.0030.00811.18
5.5.210.0030.00911.18
5.5.200.0090.00011.18
5.5.190.0030.00711.18
5.5.180.0100.00011.26
5.5.170.0060.00311.25
5.5.160.0030.00911.18
5.5.150.0080.00511.18
5.5.140.0030.01011.18
5.5.130.0030.00711.18
5.5.120.0070.00711.18
5.5.110.0030.01011.18
5.5.100.0040.00411.18
5.5.90.0090.00011.18
5.5.80.0000.01111.18
5.5.70.0040.00711.18
5.5.60.0030.00611.18
5.5.50.0030.00611.18
5.5.40.0040.00711.18
5.5.30.0030.00611.18
5.5.20.0030.00611.18
5.5.10.0070.00311.18
5.5.00.0030.00811.18
5.4.450.0030.04715.23
5.4.440.0060.03815.41
5.4.430.0030.02915.23
5.4.420.0020.03315.42
5.4.410.0050.04215.34
5.4.400.0040.03615.13
5.4.390.0060.03815.24
5.4.380.0030.02515.08
5.4.370.0020.03315.25
5.4.360.0030.03815.09
5.4.350.0030.04315.12
5.4.340.0020.03515.20
5.4.330.0060.00311.18
5.4.320.0050.04015.25
5.4.310.0030.04415.24
5.4.300.0030.04315.08
5.4.290.0030.02515.09
5.4.280.0080.03015.19
5.4.270.0050.02715.24
5.4.260.0070.02015.20
5.4.250.0040.02615.24
5.4.240.0030.03715.25
5.4.230.0050.04015.22
5.4.220.0050.03815.19
5.4.210.0050.03015.09
5.4.200.0070.02715.09
5.4.190.0030.02715.24
5.4.180.0030.02915.23
5.4.170.0060.03915.06
5.4.160.0080.03415.18
5.4.150.0060.03115.15
5.4.140.0040.04013.79
5.4.130.0000.04013.78
5.4.120.0110.03313.78
5.4.110.0050.03213.80
5.4.100.0040.03213.89
5.4.90.0040.03613.90
5.4.80.0030.03513.86
5.4.70.0080.02713.86
5.4.60.0090.03013.81
5.4.50.0060.02713.88
5.4.40.0050.03313.71
5.4.30.0100.03013.89
5.4.20.0060.03813.83
5.4.10.0060.04113.77
5.4.00.0070.03713.47
5.3.290.0090.04012.98
5.3.280.0050.03412.88
5.3.270.0050.03812.91
5.3.260.0070.02912.96
5.3.250.0060.03112.88
5.3.240.0050.03012.94
5.3.230.0090.03512.95
5.3.220.0070.03212.83
5.3.210.0040.04312.92
5.3.200.0050.03012.86
5.3.190.0080.02812.83
5.3.180.0060.03212.87
5.3.170.0050.03412.86
5.3.160.0100.02712.84
5.3.150.0040.03612.84
5.3.140.0020.03812.85
5.3.130.0040.03712.85
5.3.120.0020.04212.88
5.3.110.0040.03812.85
5.3.100.0060.03112.62
5.3.90.0030.04012.66
5.3.80.0050.04212.66
5.3.70.0060.04012.52
5.3.60.0100.03112.64
5.3.50.0090.03512.54
5.3.40.0030.04212.55
5.3.30.0060.03512.52
5.3.20.0040.03412.37
5.3.10.0000.03012.46
5.3.00.0060.03812.33
5.2.170.0030.03611.85
5.2.160.0050.03311.85
5.2.150.0030.03411.85
5.2.140.0020.03211.85
5.2.130.0060.03011.85
5.2.120.0030.03111.85
5.2.110.0020.02911.85
5.2.100.0030.03411.85
5.2.90.0030.02811.85
5.2.80.0020.02511.85
5.2.70.0010.02111.85
5.2.60.0040.02211.85
5.2.50.0000.03211.85
5.2.40.0020.03311.85
5.2.30.0020.02411.85
5.2.20.0020.02911.85
5.2.10.0040.02711.85
5.2.00.0000.02711.85
5.1.60.0060.01511.85
5.1.50.0030.02711.85
5.1.40.0070.02011.85
5.1.30.0030.02711.85
5.1.20.0050.02511.85
5.1.10.0020.03211.85
5.1.00.0050.02811.85
5.0.50.0000.02611.85
5.0.40.0020.02511.85
5.0.30.0000.02911.85
5.0.20.0010.02511.85
5.0.10.0000.02111.85
5.0.00.0040.02011.85
4.4.90.0050.01711.85
4.4.80.0000.02211.85
4.4.70.0030.01811.85
4.4.60.0030.01411.85
4.4.50.0030.01811.85
4.4.40.0020.01711.85
4.4.30.0020.01711.85
4.4.20.0030.02011.85
4.4.10.0030.02011.85
4.4.00.0020.02811.85
4.3.110.0030.01311.85
4.3.100.0010.01511.85
4.3.90.0040.01311.85
4.3.80.0050.02211.85
4.3.70.0030.01511.85
4.3.60.0030.01711.85
4.3.50.0000.01411.85
4.3.40.0020.03311.85
4.3.30.0000.01611.85
4.3.20.0030.02111.85
4.3.10.0020.01311.85
4.3.00.0030.01011.85

preferences:
43.15 ms | 400 KiB | 5 Q