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.3.60.0070.00718.64
8.3.50.0110.00418.28
8.3.40.0130.00319.22
8.3.30.0090.00619.04
8.3.20.0050.00319.14
8.3.10.0070.00319.46
8.3.00.0040.00423.73
8.2.180.0130.00618.91
8.2.170.0110.00322.96
8.2.160.0140.00422.38
8.2.150.0050.00324.18
8.2.140.0050.00224.66
8.2.130.0100.00019.89
8.2.120.0080.00026.35
8.2.110.0040.00721.19
8.2.100.0090.00317.97
8.2.90.0100.00018.16
8.2.80.0050.00318.18
8.2.70.0000.00918.18
8.2.60.0050.00318.18
8.2.50.0080.00018.10
8.2.40.0040.00419.73
8.2.30.0040.00419.68
8.2.20.0000.01018.23
8.2.10.0000.00718.33
8.2.00.0000.00719.64
8.1.280.0040.01125.92
8.1.270.0000.00823.99
8.1.260.0000.00826.35
8.1.250.0030.00628.09
8.1.240.0060.00322.55
8.1.230.0080.00321.02
8.1.220.0030.00517.93
8.1.210.0040.00418.96
8.1.200.0040.00417.48
8.1.190.0060.00317.38
8.1.180.0000.00718.10
8.1.170.0030.00618.79
8.1.160.0070.00019.11
8.1.150.0000.00719.11
8.1.140.0040.00417.97
8.1.130.0000.00719.22
8.1.120.0040.00317.77
8.1.110.0030.00617.69
8.1.100.0050.00317.56
8.1.90.0000.00717.74
8.1.80.0060.00317.75
8.1.70.0030.00617.73
8.1.60.0000.00917.76
8.1.50.0000.00917.75
8.1.40.0090.00017.81
8.1.30.0000.00817.70
8.1.20.0030.00617.74
8.1.10.0030.00517.79
8.1.00.0040.00417.68
8.0.300.0050.00320.11
8.0.290.0030.00517.00
8.0.280.0070.00018.66
8.0.270.0040.00417.53
8.0.260.0060.00317.52
8.0.250.0040.00417.32
8.0.240.0070.00017.27
8.0.230.0070.00017.08
8.0.220.0000.00717.13
8.0.210.0000.00717.06
8.0.200.0000.00717.29
8.0.190.0080.00017.29
8.0.180.0080.00017.14
8.0.170.0060.00317.08
8.0.160.0050.00217.06
8.0.150.0050.00317.18
8.0.140.0040.00417.19
8.0.130.0000.00613.68
8.0.120.0000.00817.19
8.0.110.0000.00817.08
8.0.100.0000.00817.06
8.0.90.0050.00217.21
8.0.80.0070.00917.18
8.0.70.0000.00817.06
8.0.60.0040.00417.22
8.0.50.0040.00417.03
8.0.30.0080.01317.48
8.0.20.0110.00817.40
8.0.10.0000.00817.18
8.0.00.0100.00816.97
7.4.330.0000.01015.55
7.4.320.0000.00616.82
7.4.300.0000.00616.84
7.4.290.0030.00316.80
7.4.280.0000.00816.70
7.4.270.0070.00316.76
7.4.260.0040.00416.71
7.4.250.0070.00016.79
7.4.240.0070.00016.78
7.4.230.0000.00716.90
7.4.220.0050.00316.74
7.4.210.0100.00616.79
7.4.200.0070.00016.77
7.4.160.0100.00516.85
7.4.140.0080.01017.86
7.4.130.0150.00316.80
7.4.120.0120.00916.75
7.4.110.0100.00716.60
7.4.100.0040.01316.84
7.4.90.0130.00916.69
7.4.80.0180.00819.39
7.4.70.0090.00916.75
7.4.60.0030.01316.61
7.4.50.0030.01416.59
7.4.40.0070.01116.86
7.4.10.0070.01315.04
7.4.00.0050.01214.97
7.3.330.0000.00613.39
7.3.320.0030.00313.43
7.3.310.0030.00316.30
7.3.300.0060.00016.30
7.3.290.0060.00016.53
7.3.280.0070.00716.48
7.3.260.0060.01316.52
7.3.240.0080.01216.59
7.3.230.0180.00016.78
7.3.210.0130.00916.48
7.3.200.0180.00716.61
7.3.190.0070.01016.61
7.3.180.0080.00816.44
7.3.170.0060.00916.43
7.3.160.0090.00616.80
7.3.130.0090.00314.83
7.3.120.0090.00914.81
7.3.110.0050.01515.00
7.3.100.0060.00614.99
7.3.90.0070.00714.91
7.3.80.0080.00614.96
7.3.70.0030.00814.97
7.3.60.0050.00514.71
7.3.50.0090.00614.83
7.3.40.0070.00614.72
7.3.30.0040.00714.94
7.3.20.0020.01216.63
7.3.10.0040.00616.79
7.3.00.0060.00716.77
7.2.330.0110.00716.96
7.2.320.0070.01416.74
7.2.310.0120.00916.80
7.2.300.0080.00816.92
7.2.290.0150.00816.67
7.2.260.0030.01615.12
7.2.250.0110.00714.73
7.2.240.0110.00615.13
7.2.230.0060.01015.14
7.2.220.0050.01115.14
7.2.210.0110.00115.26
7.2.200.0020.01115.17
7.2.190.0050.01215.19
7.2.180.0090.00415.14
7.2.170.0040.01215.25
7.2.160.0040.00714.98
7.2.150.0050.00517.06
7.2.140.0030.01016.92
7.2.130.0040.00716.90
7.2.120.0080.00816.96
7.2.110.0050.00717.15
7.2.100.0020.01317.03
7.2.90.0050.00817.02
7.2.80.0060.00717.15
7.2.70.0060.00616.85
7.2.60.0160.00916.14
7.2.50.0120.00916.18
7.2.40.0130.00916.46
7.2.30.0150.00916.24
7.2.20.0150.01016.37
7.2.10.0150.00816.31
7.2.00.0170.00516.43
7.1.330.0060.00815.95
7.1.320.0050.00715.87
7.1.310.0020.01215.85
7.1.300.0080.00715.80
7.1.290.0090.00316.06
7.1.280.0020.01315.74
7.1.270.0030.01015.68
7.1.260.0040.01015.74
7.1.250.0080.00615.87
7.1.240.0060.00315.83
7.1.230.0040.01116.00
7.1.220.0000.01415.98
7.1.210.0060.00615.95
7.1.200.0110.00315.81
7.1.190.0000.01515.99
7.1.180.0030.00615.87
7.1.170.0170.00614.85
7.1.160.0210.01014.83
7.1.150.0190.01214.94
7.1.140.0200.00614.85
7.1.130.0160.00914.83
7.1.120.0170.00814.70
7.1.110.0190.00714.82
7.1.100.0170.00614.63
7.1.90.0230.00414.96
7.1.80.0230.01014.88
7.1.70.0200.00814.82
7.1.60.0310.00923.84
7.1.50.0690.01223.84
7.1.40.0320.00923.80
7.1.30.0270.01723.82
7.1.20.0330.00823.74
7.1.10.0250.01314.98
7.1.00.0180.01014.74
7.0.330.0080.00415.36
7.0.320.0030.01015.29
7.0.310.0000.01615.59
7.0.300.0030.00915.43
7.0.290.0080.00815.33
7.0.280.0090.00315.43
7.0.270.0070.00715.48
7.0.260.0140.00415.85
7.0.250.0030.01015.37
7.0.240.0030.01015.48
7.0.230.0040.01215.46
7.0.220.0000.01215.57
7.0.210.0040.01115.64
7.0.200.0030.00715.41
7.0.190.0070.00315.46
7.0.180.0000.01415.51
7.0.170.0070.00415.69
7.0.160.0040.01115.45
7.0.150.0030.01115.43
7.0.140.0030.00915.62
7.0.130.0070.00715.29
7.0.120.0030.01015.73
7.0.110.0070.00715.42
7.0.100.0060.00615.53
7.0.90.0050.00515.34
7.0.80.0050.00515.45
7.0.70.0100.00715.66
7.0.60.0030.01315.56
7.0.50.0090.00615.76
7.0.40.0120.00313.59
7.0.30.0030.00913.49
7.0.20.0090.00613.83
7.0.10.0060.00913.64
7.0.00.0000.01413.63
5.6.400.0100.00014.67
5.6.390.0150.00014.71
5.6.380.0060.00614.61
5.6.370.0030.00914.78
5.6.360.0030.00614.58
5.6.350.0060.00914.50
5.6.340.0000.01214.16
5.6.330.0000.00914.65
5.6.320.0070.00714.64
5.6.310.0000.01514.61
5.6.300.0000.01014.62
5.6.290.0080.00414.31
5.6.280.0030.00714.38
5.6.270.0030.01014.56
5.6.260.0060.00814.69
5.6.250.0070.00714.63
5.6.240.0130.00314.48
5.6.230.0040.01114.49
5.6.220.0000.01614.46
5.6.210.0070.01014.31
5.6.200.0030.00614.47
5.6.190.0060.00914.47
5.6.180.0070.00714.46
5.6.170.0070.00714.50
5.6.160.0030.01214.76
5.6.150.0070.00714.25
5.6.140.0120.00614.36
5.6.130.0030.01314.51
5.6.120.0000.01514.52
5.6.110.0000.01514.49
5.6.100.0030.01414.53
5.6.90.0030.01314.49
5.6.80.0130.00014.61
5.6.70.0030.00714.48
5.6.60.0060.00614.32
5.6.50.0070.00714.61
5.6.40.0100.00714.31
5.6.30.0040.01414.51
5.6.20.0150.00014.65
5.6.10.0070.00714.48
5.6.00.0080.00614.42

preferences:
62.58 ms | 400 KiB | 5 Q