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> </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.81
8.3.50.0100.00718.13
8.3.40.0090.00619.21
8.3.30.0110.00419.09
8.3.20.0040.00419.35
8.3.10.0070.00421.33
8.3.00.0000.00823.89
8.2.180.0180.00416.88
8.2.170.0110.00422.96
8.2.160.0070.01122.48
8.2.150.0050.00324.18
8.2.140.0060.00324.66
8.2.130.0040.00718.34
8.2.120.0050.00226.35
8.2.110.0050.00522.48
8.2.100.0040.00818.16
8.2.90.0090.00019.95
8.2.80.0000.00817.97
8.2.70.0040.00417.88
8.2.60.0040.00418.05
8.2.50.0030.00518.07
8.2.40.0040.00420.14
8.2.30.0040.00418.39
8.2.20.0040.00418.27
8.2.10.0000.00818.32
8.2.00.0000.00719.69
8.1.280.0060.00925.92
8.1.270.0080.00020.36
8.1.260.0040.00426.35
8.1.250.0030.00528.09
8.1.240.0100.00022.67
8.1.230.0070.00421.15
8.1.220.0000.00817.88
8.1.210.0030.00619.16
8.1.200.0090.00017.60
8.1.190.0030.00717.60
8.1.180.0080.00018.10
8.1.170.0040.00418.83
8.1.160.0000.00719.13
8.1.150.0040.00419.19
8.1.140.0040.00417.84
8.1.130.0000.00719.23
8.1.120.0000.00717.58
8.1.110.0000.00917.54
8.1.100.0030.00617.64
8.1.90.0000.00717.55
8.1.80.0050.00317.59
8.1.70.0040.00417.55
8.1.60.0060.00317.67
8.1.50.0000.00817.78
8.1.40.0000.00817.73
8.1.30.0050.00317.89
8.1.20.0000.00717.73
8.1.10.0000.00817.78
8.1.00.0030.00617.77
8.0.300.0080.00020.14
8.0.290.0060.00317.00
8.0.280.0040.00418.69
8.0.270.0050.00217.46
8.0.260.0080.00017.59
8.0.250.0030.00317.22
8.0.240.0030.00317.06
8.0.230.0040.00417.21
8.0.220.0040.00517.20
8.0.210.0000.00716.99
8.0.200.0040.00417.13
8.0.190.0030.00617.13
8.0.180.0000.00817.25
8.0.170.0030.00617.25
8.0.160.0040.00417.17
8.0.150.0040.00417.04
8.0.140.0030.00617.14
8.0.130.0060.00013.74
8.0.120.0000.00817.00
8.0.110.0040.00417.08
8.0.100.0060.00317.08
8.0.90.0000.00717.07
8.0.80.0060.01117.17
8.0.70.0040.00417.08
8.0.60.0040.00417.00
8.0.50.0040.00416.92
8.0.30.0050.01217.37
8.0.20.0110.01117.40
8.0.10.0070.00017.36
8.0.00.0100.00716.87
7.4.330.0000.00615.55
7.4.320.0070.00016.85
7.4.300.0060.00016.82
7.4.290.0000.00716.84
7.4.280.0040.00416.65
7.4.270.0100.00016.69
7.4.260.0040.00416.86
7.4.250.0000.00716.88
7.4.240.0000.00716.82
7.4.230.0030.00317.01
7.4.220.0030.00516.73
7.4.210.0110.00316.86
7.4.200.0000.00716.67
7.4.160.0110.00816.82
7.4.140.0120.00717.86
7.4.130.0070.01016.87
7.4.120.0120.00916.68
7.4.110.0070.01116.84
7.4.100.0060.01216.85
7.4.90.0110.01116.76
7.4.80.0100.00919.39
7.4.70.0060.01216.61
7.4.60.0100.00616.84
7.4.50.0000.01416.86
7.4.40.0100.01016.81
7.4.10.0060.01315.13
7.4.00.0080.00814.95
7.3.330.0000.00513.58
7.3.320.0060.00013.55
7.3.310.0000.00716.40
7.3.300.0070.00016.55
7.3.290.0070.00016.50
7.3.280.0030.01216.45
7.3.260.0120.00816.67
7.3.240.0100.00916.52
7.3.230.0040.01216.87
7.3.210.0110.01116.55
7.3.200.0060.00316.66
7.3.190.0110.00716.86
7.3.180.0070.01416.70
7.3.170.0110.00716.89
7.3.160.0110.00616.60
7.3.130.0030.01315.05
7.3.120.0090.01014.80
7.3.110.0080.00914.83
7.3.100.0080.00815.06
7.3.90.0050.00714.74
7.3.80.0040.00914.84
7.3.70.0110.00714.93
7.3.60.0070.00814.92
7.3.50.0040.00814.95
7.3.40.0050.00814.64
7.3.30.0070.01014.85
7.3.20.0090.00316.64
7.3.10.0050.00816.69
7.3.00.0050.00716.33
7.2.330.0110.00716.65
7.2.320.0060.01216.70
7.2.310.0060.01316.84
7.2.300.0120.01116.90
7.2.290.0090.01216.77
7.2.260.0070.01514.85
7.2.250.0110.01115.08
7.2.240.0050.00815.09
7.2.230.0050.00914.89
7.2.220.0050.01214.87
7.2.210.0020.01215.02
7.2.200.0090.00715.13
7.2.190.0040.01114.98
7.2.180.0070.00914.81
7.2.170.0050.01015.00
7.2.160.0030.01015.04
7.2.150.0050.00916.86
7.2.140.0030.01016.84
7.2.130.0010.01016.76
7.2.120.0090.00516.89
7.2.110.0060.00616.92
7.2.100.0080.00916.89
7.2.90.0070.00416.79
7.2.80.0050.01016.84
7.2.70.0050.01116.80
7.2.60.0240.00816.15
7.2.50.0200.00916.22
7.2.40.0180.01116.11
7.2.30.0190.00916.03
7.2.20.0220.00516.13
7.2.10.0120.01416.11
7.2.00.0170.00916.23
7.1.330.0060.00915.77
7.1.320.0110.00215.58
7.1.310.0030.01215.83
7.1.300.0030.01215.78
7.1.290.0110.00215.80
7.1.280.0060.01015.80
7.1.270.0070.00415.69
7.1.260.0050.00815.82
7.1.250.0070.00515.94
7.1.240.0090.00615.88
7.1.230.0030.01415.85
7.1.220.0000.01215.75
7.1.210.0000.00915.71
7.1.200.0040.00915.63
7.1.190.0000.01415.75
7.1.180.0100.00315.73
7.1.170.0190.01014.64
7.1.160.0260.00314.69
7.1.150.0270.00614.74
7.1.140.0240.00714.66
7.1.130.0280.00514.54
7.1.120.0200.00714.62
7.1.110.0260.01114.66
7.1.100.0220.01014.98
7.1.90.0420.00914.60
7.1.80.0190.00714.77
7.1.70.0210.00614.90
7.1.60.0290.01123.73
7.1.50.0370.00623.62
7.1.40.0320.01323.78
7.1.30.0530.01023.48
7.1.20.0450.01623.51
7.1.10.0380.01014.57
7.1.00.0290.00714.68
7.0.330.0040.01115.50
7.0.320.0040.01115.32
7.0.310.0110.00315.39
7.0.300.0090.00315.37
7.0.290.0100.00315.19
7.0.280.0130.00015.42
7.0.270.0060.00915.30
7.0.260.0050.00515.35
7.0.250.0030.00715.46
7.0.240.0030.00715.44
7.0.230.0070.00715.37
7.0.220.0040.00715.38
7.0.210.0070.00715.58
7.0.200.0070.00715.18
7.0.190.0110.00315.60
7.0.180.0060.00615.38
7.0.170.0030.01015.51
7.0.160.0060.00615.67
7.0.150.0030.01015.54
7.0.140.0090.00315.44
7.0.130.0030.01315.36
7.0.120.0000.01515.52
7.0.110.0030.01015.39
7.0.100.0040.00815.50
7.0.90.0070.00715.47
7.0.80.0040.01115.46
7.0.70.0060.00315.44
7.0.60.0080.00415.22
7.0.50.0070.00415.47
7.0.40.0070.00313.24
7.0.30.0040.01113.75
7.0.20.0060.00313.46
7.0.10.0070.01013.44
7.0.00.0090.00913.46
5.6.400.0070.00714.41
5.6.390.0040.00814.40
5.6.380.0030.01214.64
5.6.370.0090.00014.45
5.6.360.0070.01014.68
5.6.350.0110.00714.11
5.6.340.0080.00414.33
5.6.330.0040.01414.46
5.6.320.0090.00614.04
5.6.310.0120.00314.43
5.6.300.0000.01114.43
5.6.290.0080.00814.57
5.6.280.0090.00314.46
5.6.270.0090.00414.42
5.6.260.0030.01014.17
5.6.250.0110.00414.30
5.6.240.0090.00614.50
5.6.230.0060.01014.17
5.6.220.0070.00314.46
5.6.210.0040.00814.54
5.6.200.0080.00414.16
5.6.190.0070.00714.62
5.6.180.0070.01114.48
5.6.170.0070.01014.61
5.6.160.0000.00914.17
5.6.150.0030.01014.54
5.6.140.0040.00714.31
5.6.130.0110.00414.25
5.6.120.0000.01414.71
5.6.110.0030.00714.27
5.6.100.0030.01014.34
5.6.90.0050.00514.46
5.6.80.0030.00614.21
5.6.70.0070.01014.26
5.6.60.0040.01114.05
5.6.50.0030.00714.58
5.6.40.0060.00614.18
5.6.30.0090.00614.35
5.6.20.0060.00814.20
5.6.10.0030.01314.38
5.6.00.0090.00914.40

preferences:
40.19 ms | 400 KiB | 5 Q