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['seconds']; 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.0080.00818.65
8.3.50.0040.01117.99
8.3.40.0070.01119.22
8.3.30.0120.00319.09
8.3.20.0080.00019.23
8.3.10.0000.01219.31
8.3.00.0050.00323.93
8.2.180.0040.01517.13
8.2.170.0090.00622.96
8.2.160.0100.00322.27
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0060.00319.72
8.2.120.0120.00026.35
8.2.110.0040.00421.09
8.2.100.0070.00418.53
8.2.90.0000.00819.46
8.2.80.0060.00317.97
8.2.70.0040.00418.29
8.2.60.0030.00518.18
8.2.50.0060.00319.55
8.2.40.0060.00319.76
8.2.30.0070.00019.66
8.2.20.0030.00818.40
8.2.10.0040.00418.39
8.2.00.0040.00419.72
8.1.280.0040.01125.92
8.1.270.0050.00323.99
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0060.00321.68
8.1.230.0070.00417.95
8.1.220.0080.00017.90
8.1.210.0000.00918.77
8.1.200.0030.00617.35
8.1.190.0080.00017.35
8.1.180.0040.00418.10
8.1.170.0090.00018.80
8.1.160.0070.00019.07
8.1.150.0040.00419.11
8.1.140.0000.00717.92
8.1.130.0000.00719.23
8.1.120.0000.00917.55
8.1.110.0030.00617.62
8.1.100.0060.00317.64
8.1.90.0000.00717.73
8.1.80.0040.00417.70
8.1.70.0050.00517.74
8.1.60.0050.00317.66
8.1.50.0000.00817.76
8.1.40.0040.00417.75
8.1.30.0000.00817.76
8.1.20.0040.00417.87
8.1.10.0030.00617.89
8.1.00.0030.00517.79
8.0.300.0080.00018.96
8.0.290.0040.00417.00
8.0.280.0000.00718.70
8.0.270.0000.00717.47
8.0.260.0000.00717.48
8.0.250.0000.00717.11
8.0.240.0000.00717.20
8.0.230.0000.00717.23
8.0.220.0000.00717.19
8.0.210.0030.00317.02
8.0.200.0000.00717.14
8.0.190.0080.00017.28
8.0.180.0050.00217.22
8.0.170.0040.00417.25
8.0.160.0000.00717.27
8.0.150.0060.00317.17
8.0.140.0070.00017.08
8.0.130.0030.00313.66
8.0.120.0050.00317.19
8.0.110.0000.00717.05
8.0.100.0030.00516.91
8.0.90.0050.00217.13
8.0.80.0100.00717.11
8.0.70.0000.00717.09
8.0.60.0000.00717.23
8.0.50.0070.00017.29
8.0.30.0090.00817.38
8.0.20.0090.01017.40
8.0.10.0040.00417.27
8.0.00.0090.01017.09
7.4.330.0030.00315.55
7.4.320.0000.00616.61
7.4.300.0060.00016.64
7.4.290.0030.00316.81
7.4.280.0000.00816.84
7.4.270.0030.00516.65
7.4.260.0050.00316.70
7.4.250.0070.00016.57
7.4.240.0000.00816.70
7.4.230.0030.00316.70
7.4.220.0040.00416.92
7.4.210.0100.00516.89
7.4.200.0080.00016.63
7.4.160.0070.01016.68
7.4.140.0100.00817.86
7.4.130.0110.00716.81
7.4.120.0080.01316.80
7.4.110.0140.00416.71
7.4.100.0150.00616.52
7.4.90.0090.00916.80
7.4.80.0090.00919.39
7.4.70.0050.01616.75
7.4.60.0100.00616.66
7.4.50.0060.00616.84
7.4.40.0090.01016.89
7.4.10.0120.00614.90
7.4.00.0060.01214.84
7.3.330.0030.00313.42
7.3.320.0050.00013.32
7.3.310.0050.00216.55
7.3.300.0040.00416.39
7.3.290.0030.00316.49
7.3.280.0090.00616.53
7.3.260.0090.01116.51
7.3.240.0080.01116.60
7.3.230.0040.01516.48
7.3.210.0120.00616.43
7.3.200.0040.01516.72
7.3.190.0030.01316.77
7.3.180.0100.00716.56
7.3.170.0040.01216.55
7.3.160.0130.00316.70
7.3.130.0080.01115.20
7.3.120.0110.00514.89
7.3.110.0060.01214.76
7.3.100.0020.01514.94
7.3.90.0100.00815.07
7.3.80.0050.00814.91
7.3.70.0060.00914.88
7.3.60.0000.01414.85
7.3.50.0080.00715.02
7.3.40.0030.01014.94
7.3.30.0020.00914.85
7.3.20.0070.00516.74
7.3.10.0080.00916.80
7.3.00.0050.00816.65
7.2.330.0060.01216.94
7.2.320.0140.01016.96
7.2.310.0130.01016.56
7.2.300.0150.00316.78
7.2.290.0120.00617.03
7.2.260.0030.00915.41
7.2.250.0090.00915.16
7.2.240.0060.01014.88
7.2.230.0070.01115.08
7.2.220.0100.00315.11
7.2.210.0080.00815.10
7.2.200.0030.01015.24
7.2.190.0120.00415.27
7.2.180.0060.00915.08
7.2.170.0050.00715.02
7.2.160.0110.00414.91
7.2.150.0070.01016.89
7.2.140.0100.01016.84
7.2.130.0080.00417.11
7.2.120.0060.00916.92
7.2.110.0140.00316.99
7.2.100.0030.00717.00
7.2.90.0090.00617.09
7.2.80.0000.01517.00
7.2.70.0070.01116.69
7.2.60.0260.00515.92
7.2.50.0210.00716.05
7.2.40.0210.00916.14
7.2.30.0180.00916.03
7.2.20.0220.00616.10
7.2.10.0190.01116.05
7.2.00.0280.00816.17
7.1.330.0060.00615.69
7.1.320.0080.00816.03
7.1.310.0030.00915.90
7.1.300.0060.00715.85
7.1.290.0060.00815.98
7.1.280.0040.01015.85
7.1.270.0050.00915.84
7.1.260.0050.00715.95
7.1.250.0060.00315.80
7.1.240.0000.01415.96
7.1.230.0030.01015.86
7.1.220.0070.00715.99
7.1.210.0070.00715.70
7.1.200.0060.00415.75
7.1.190.0030.00715.99
7.1.180.0040.00415.71
7.1.170.0170.00614.86
7.1.160.0200.00714.92
7.1.150.0190.00714.92
7.1.140.0200.00514.96
7.1.130.0170.01014.86
7.1.120.0250.01014.69
7.1.110.0170.01114.70
7.1.100.0220.00414.79
7.1.90.0240.00914.71
7.1.80.0210.01014.87
7.1.70.0240.00514.92
7.1.60.0290.01023.79
7.1.50.0340.00923.80
7.1.40.0320.01523.90
7.1.30.0790.00623.59
7.1.20.0380.01423.67
7.1.10.0330.00614.73
7.1.00.0350.00514.67
7.0.330.0040.00815.43
7.0.320.0070.00715.50
7.0.310.0000.00915.63
7.0.300.0060.00915.66
7.0.290.0060.01215.58
7.0.280.0110.00415.20
7.0.270.0040.01115.40
7.0.260.0000.01315.36
7.0.250.0060.00615.53
7.0.240.0100.00715.39
7.0.230.0040.00715.61
7.0.220.0060.01015.55
7.0.210.0080.00815.75
7.0.200.0090.00615.44
7.0.190.0150.00315.45
7.0.180.0040.01215.71
7.0.170.0030.01315.59
7.0.160.0000.01315.54
7.0.150.0040.00815.55
7.0.140.0110.00415.57
7.0.130.0090.00615.61
7.0.120.0000.01215.46
7.0.110.0050.00515.53
7.0.100.0030.00515.75
7.0.90.0030.00915.51
7.0.80.0120.00015.73
7.0.70.0100.00315.30
7.0.60.0040.01115.64
7.0.50.0060.00615.59
7.0.40.0070.01013.50
7.0.30.0000.01513.54
7.0.20.0040.01013.50
7.0.10.0000.01013.52
7.0.00.0000.01213.59
5.6.400.0040.01114.67
5.6.390.0090.00614.36
5.6.380.0110.00314.09
5.6.370.0070.00714.81
5.6.360.0100.00314.51
5.6.350.0060.00914.43
5.6.340.0000.01114.67
5.6.330.0080.00814.71
5.6.320.0090.00314.98
5.6.310.0070.01014.64
5.6.300.0030.01314.57
5.6.290.0060.00914.98
5.6.280.0070.01014.62
5.6.270.0120.00314.61
5.6.260.0080.00314.49
5.6.250.0100.00714.97
5.6.240.0070.00714.48
5.6.230.0040.00814.45
5.6.220.0110.00414.36
5.6.210.0040.01114.57
5.6.200.0090.00614.55
5.6.190.0060.00914.45
5.6.180.0000.01514.59
5.6.170.0070.00714.71
5.6.160.0090.00314.38
5.6.150.0120.00314.52
5.6.140.0070.01014.66
5.6.130.0130.00014.63
5.6.120.0060.00614.14
5.6.110.0110.00714.71
5.6.100.0070.01014.39
5.6.90.0110.00714.50
5.6.80.0140.00414.70
5.6.70.0030.01414.55
5.6.60.0060.01214.63
5.6.50.0030.01314.34
5.6.40.0060.00914.43
5.6.30.0000.01214.27
5.6.20.0150.00314.51
5.6.10.0120.00314.73
5.6.00.0060.01014.71

preferences:
63.44 ms | 401 KiB | 5 Q