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 = '<ns:feed xmlns:ns="http://www.w3.org/2005/Atom" xmlns:yt="http://gdata.youtube.com/schemas/2007"> <ns:entry> <yt:duration seconds="1870"/> </ns:entry> </ns: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.0120.00318.41
8.3.50.0090.00618.16
8.3.40.0040.01118.92
8.3.30.0070.00718.80
8.3.20.0000.00819.29
8.3.10.0040.00819.34
8.3.00.0080.00023.78
8.2.180.0070.01416.75
8.2.170.0110.00422.96
8.2.160.0100.00322.33
8.2.150.0040.00424.18
8.2.140.0070.00024.66
8.2.130.0070.00320.01
8.2.120.0040.00426.35
8.2.110.0080.00319.50
8.2.100.0060.00617.97
8.2.90.0090.00018.15
8.2.80.0040.00418.47
8.2.70.0000.00917.91
8.2.60.0040.00418.18
8.2.50.0000.00818.10
8.2.40.0070.00019.54
8.2.30.0040.00419.72
8.2.20.0060.00318.23
8.2.10.0040.00418.29
8.2.00.0000.00719.59
8.1.280.0000.01525.92
8.1.270.0070.00020.32
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0090.00019.63
8.1.230.0110.00021.16
8.1.220.0040.00417.93
8.1.210.0050.00319.06
8.1.200.0050.00517.48
8.1.190.0040.00417.48
8.1.180.0000.00818.10
8.1.170.0040.00418.75
8.1.160.0000.00719.12
8.1.150.0000.00719.17
8.1.140.0040.00417.81
8.1.130.0000.00719.20
8.1.120.0030.00317.74
8.1.110.0070.00317.68
8.1.100.0030.00517.74
8.1.90.0040.00417.57
8.1.80.0040.00417.50
8.1.70.0060.00317.64
8.1.60.0050.00317.70
8.1.50.0050.00217.79
8.1.40.0000.00817.80
8.1.30.0040.00417.77
8.1.20.0060.00317.70
8.1.10.0080.00017.70
8.1.00.0000.00817.65
8.0.300.0030.00520.15
8.0.290.0070.00016.88
8.0.280.0000.00718.55
8.0.270.0000.00717.53
8.0.260.0070.00017.47
8.0.250.0040.00417.21
8.0.240.0030.00317.04
8.0.230.0000.00717.04
8.0.220.0070.00017.15
8.0.210.0040.00417.07
8.0.200.0030.00517.19
8.0.190.0060.00317.04
8.0.180.0040.00417.17
8.0.170.0050.00517.23
8.0.160.0000.00716.97
8.0.150.0000.00817.02
8.0.140.0030.00417.10
8.0.130.0000.00613.60
8.0.120.0000.00817.03
8.0.110.0040.00417.07
8.0.100.0040.00417.00
8.0.90.0000.00716.93
8.0.80.0080.01017.06
8.0.70.0050.00217.14
8.0.60.0030.00517.17
8.0.50.0040.00416.95
8.0.30.0080.01017.23
8.0.20.0170.00217.41
8.0.10.0040.00417.10
8.0.00.0120.00617.07
7.4.330.0060.00015.55
7.4.320.0030.00316.80
7.4.300.0060.00016.82
7.4.290.0070.00016.81
7.4.280.0040.00416.63
7.4.270.0060.00316.71
7.4.260.0030.00616.70
7.4.250.0000.00816.71
7.4.240.0000.00816.73
7.4.230.0000.00716.71
7.4.220.0020.00516.83
7.4.210.0100.00716.79
7.4.200.0040.00416.59
7.4.160.0080.01016.72
7.4.140.0080.01017.86
7.4.130.0080.00816.64
7.4.120.0110.01116.67
7.4.110.0210.00416.73
7.4.100.0100.00716.72
7.4.90.0090.00916.59
7.4.80.0070.01119.39
7.4.70.0070.01016.71
7.4.60.0110.00616.46
7.4.50.0060.00616.74
7.4.40.0070.01016.88
7.4.10.0060.00915.06
7.4.00.0060.01014.93
7.3.330.0000.00513.20
7.3.320.0060.00013.25
7.3.310.0030.00316.39
7.3.300.0070.00016.38
7.3.290.0070.00016.27
7.3.280.0040.01016.31
7.3.260.0100.01116.41
7.3.240.0070.01116.67
7.3.230.0140.00416.41
7.3.210.0150.00916.68
7.3.200.0190.00316.62
7.3.190.0030.01316.53
7.3.180.0030.01216.55
7.3.170.0090.00616.54
7.3.160.0060.00916.35
7.3.130.0040.01514.66
7.3.120.0030.01214.83
7.3.110.0110.00714.93
7.3.100.0060.00914.69
7.3.90.0070.00814.69
7.3.80.0070.00714.90
7.3.70.0050.01114.59
7.3.60.0100.00514.80
7.3.50.0060.00914.85
7.3.40.0070.00914.75
7.3.30.0050.01014.89
7.3.20.0040.00816.52
7.3.10.0060.00616.54
7.3.00.0040.00916.63
7.2.330.0150.00816.70
7.2.320.0070.01016.44
7.2.310.0070.01116.68
7.2.300.0100.00616.62
7.2.290.0130.01016.57
7.2.260.0030.01615.21
7.2.250.0080.01115.14
7.2.240.0090.00814.97
7.2.230.0050.00515.24
7.2.220.0050.00915.19
7.2.210.0070.00715.03
7.2.200.0020.01015.23
7.2.190.0050.00914.84
7.2.180.0040.01215.11
7.2.170.0070.00915.12
7.2.160.0030.01015.21
7.2.150.0060.01016.95
7.2.140.0030.01217.00
7.2.130.0090.00416.96
7.2.120.0100.00316.95
7.2.110.0030.01016.98
7.2.100.0060.00617.11
7.2.90.0030.01016.96
7.2.80.0090.00616.96
7.2.70.0000.01117.05
7.2.60.0150.01115.85
7.2.50.0190.01015.93
7.2.40.0210.00615.95
7.2.30.0300.00715.97
7.2.20.0170.00915.94
7.2.10.0180.00816.09
7.2.00.0210.00815.92
7.1.330.0060.00715.93
7.1.320.0070.00916.02
7.1.310.0100.00515.75
7.1.300.0040.01315.78
7.1.290.0090.00615.94
7.1.280.0030.01315.73
7.1.270.0000.00915.81
7.1.260.0050.00715.79
7.1.250.0060.00316.17
7.1.240.0060.00315.60
7.1.230.0040.00715.93
7.1.220.0100.00315.79
7.1.210.0030.00615.86
7.1.200.0080.00315.61
7.1.190.0070.00315.75
7.1.180.0040.00815.98
7.1.170.0230.00714.86
7.1.160.0230.01014.85
7.1.150.0200.00714.73
7.1.140.0190.00614.87
7.1.130.0310.01014.83
7.1.120.0170.00714.81
7.1.110.0440.00714.79
7.1.100.0180.00814.62
7.1.90.0350.00614.66
7.1.80.0330.00814.84
7.1.70.0230.00814.87
7.1.60.0420.01123.81
7.1.50.0480.00623.75
7.1.40.0390.00723.76
7.1.30.0330.01123.83
7.1.20.0420.00923.68
7.1.10.0250.00614.58
7.1.00.0380.00314.83
7.0.330.0030.00615.48
7.0.320.0030.00915.50
7.0.310.0000.01215.49
7.0.300.0040.00715.41
7.0.290.0060.00915.68
7.0.280.0030.00515.37
7.0.270.0040.01115.38
7.0.260.0030.00915.36
7.0.250.0030.00615.41
7.0.240.0080.00815.39
7.0.230.0070.00715.55
7.0.220.0030.01015.55
7.0.210.0060.00615.46
7.0.200.0070.00715.59
7.0.190.0040.00815.56
7.0.180.0000.01115.52
7.0.170.0060.00615.63
7.0.160.0030.01415.64
7.0.150.0040.01415.60
7.0.140.0000.01115.49
7.0.130.0030.00715.61
7.0.120.0070.00415.67
7.0.110.0030.00915.54
7.0.100.0000.01615.48
7.0.90.0000.00915.43
7.0.80.0040.00815.45
7.0.70.0000.00815.30
7.0.60.0030.00615.82
7.0.50.0070.00715.71
7.0.40.0030.01013.52
7.0.30.0090.00913.27
7.0.20.0040.01113.47
7.0.10.0100.00313.29
7.0.00.0060.00313.36
5.6.400.0030.01014.18
5.6.390.0000.01214.29
5.6.380.0040.01114.29
5.6.370.0060.00914.55
5.6.360.0030.01214.29
5.6.350.0100.00714.41
5.6.340.0070.00714.71
5.6.330.0000.01514.48
5.6.320.0120.00414.57
5.6.310.0060.00614.51
5.6.300.0040.00414.59
5.6.290.0000.01014.48
5.6.280.0050.00514.61
5.6.270.0060.00614.25
5.6.260.0030.01114.45
5.6.250.0130.00314.32
5.6.240.0030.01014.31
5.6.230.0070.00714.47
5.6.220.0000.01414.32
5.6.210.0040.00814.33
5.6.200.0000.01514.27
5.6.190.0100.00714.40
5.6.180.0070.01014.59
5.6.170.0120.00314.71
5.6.160.0060.00314.32
5.6.150.0050.00314.47
5.6.140.0070.00714.03
5.6.130.0040.01114.32
5.6.120.0060.00314.37
5.6.110.0070.00314.47
5.6.100.0030.01014.31
5.6.90.0070.00714.20
5.6.80.0080.00414.39
5.6.70.0070.00714.19
5.6.60.0030.00514.55
5.6.50.0070.00314.27
5.6.40.0000.00914.56
5.6.30.0120.00314.52
5.6.20.0000.00814.21
5.6.10.0040.00714.31
5.6.00.0090.00614.34

preferences:
95.19 ms | 401 KiB | 5 Q