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']); print_r($yt->duration); $seconds = $yt->duration['seconds']; echo $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.70.0150.00616.75
8.3.60.0070.00718.55
8.3.50.0120.00318.21
8.3.40.0120.00619.03
8.3.30.0070.00718.96
8.3.20.0080.00019.35
8.3.10.0040.00719.11
8.3.00.0040.00423.73
8.2.180.0130.00617.00
8.2.170.0040.01122.96
8.2.160.0120.00322.27
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0030.00718.30
8.2.120.0050.00326.35
8.2.110.0000.00921.09
8.2.100.0040.00818.09
8.2.90.0050.00318.09
8.2.80.0040.00418.47
8.2.70.0080.00418.05
8.2.60.0040.00418.18
8.2.50.0030.00618.10
8.2.40.0000.00819.64
8.2.30.0050.00219.59
8.2.20.0000.00818.07
8.2.10.0040.00418.21
8.2.00.0030.00319.61
8.1.280.0110.00425.92
8.1.270.0050.00320.58
8.1.260.0050.00326.35
8.1.250.0090.00028.09
8.1.240.0000.00922.77
8.1.230.0090.00321.00
8.1.220.0000.00917.91
8.1.210.0070.00219.07
8.1.200.0090.00017.60
8.1.190.0040.00417.36
8.1.180.0000.00818.10
8.1.170.0040.00418.84
8.1.160.0070.00019.11
8.1.150.0000.00819.01
8.1.140.0000.00717.96
8.1.130.0030.00319.23
8.1.120.0000.00717.54
8.1.110.0000.01117.56
8.1.100.0000.00717.71
8.1.90.0040.00417.73
8.1.80.0050.00317.70
8.1.70.0070.00417.63
8.1.60.0050.00317.77
8.1.50.0040.00417.79
8.1.40.0000.00817.76
8.1.30.0000.00817.76
8.1.20.0040.00417.82
8.1.10.0000.00817.75
8.1.00.0030.00617.59
8.0.300.0000.00720.15
8.0.290.0000.00816.88
8.0.280.0000.00718.61
8.0.270.0000.00717.48
8.0.260.0000.00917.38
8.0.250.0000.00817.27
8.0.240.0030.00317.23
8.0.230.0030.00317.23
8.0.220.0040.00417.07
8.0.210.0000.00717.06
8.0.200.0040.00417.23
8.0.190.0030.00617.18
8.0.180.0040.00417.02
8.0.170.0050.00317.00
8.0.160.0000.00817.04
8.0.150.0030.00616.96
8.0.140.0000.00817.08
8.0.130.0030.00313.57
8.0.120.0040.00416.95
8.0.110.0000.00717.01
8.0.100.0050.00217.03
8.0.90.0000.00717.07
8.0.80.0110.00517.08
8.0.70.0040.00416.96
8.0.60.0040.00416.93
8.0.50.0000.00817.03
8.0.30.0110.00617.39
8.0.20.0070.01317.40
8.0.10.0000.00717.04
8.0.00.0060.01117.16
7.4.330.0030.00315.55
7.4.320.0030.00316.80
7.4.300.0040.00416.64
7.4.290.0070.00016.89
7.4.280.0000.00716.73
7.4.270.0000.00916.70
7.4.260.0000.00716.63
7.4.250.0040.00416.76
7.4.240.0000.00716.74
7.4.230.0030.00316.77
7.4.220.0040.00416.84
7.4.210.0080.00916.83
7.4.200.0030.00316.90
7.4.160.0090.00816.69
7.4.140.0130.00717.86
7.4.130.0060.01216.55
7.4.120.0100.01416.70
7.4.110.0040.01416.64
7.4.100.0120.00916.61
7.4.90.0130.00316.84
7.4.80.0180.00619.39
7.4.70.0130.01016.69
7.4.60.0160.00016.63
7.4.50.0100.00616.87
7.4.40.0090.01016.80
7.4.10.0070.01115.10
7.4.00.0040.01015.04
7.3.330.0060.00013.46
7.3.320.0030.00313.46
7.3.310.0040.00416.62
7.3.300.0000.00616.57
7.3.290.0000.00716.45
7.3.280.0090.00616.54
7.3.260.0090.00916.73
7.3.240.0090.00816.67
7.3.230.0090.00916.45
7.3.210.0100.01016.65
7.3.200.0090.01416.89
7.3.190.0060.01316.66
7.3.180.0120.00316.65
7.3.170.0030.01316.53
7.3.160.0170.00016.55
7.3.130.0110.00715.07
7.3.120.0000.01214.65
7.3.110.0030.01514.85
7.3.100.0090.00614.97
7.3.90.0070.01014.96
7.3.80.0000.01514.79
7.3.70.0070.00714.83
7.3.60.0060.00614.94
7.3.50.0060.00315.10
7.3.40.0090.00414.93
7.3.30.0140.00014.97
7.3.20.0060.00916.62
7.3.10.0030.00616.53
7.3.00.0040.01116.67
7.2.330.0150.00916.77
7.2.320.0130.01316.98
7.2.310.0090.00917.00
7.2.300.0060.01017.00
7.2.290.0160.00616.75
7.2.260.0110.00714.87
7.2.250.0070.01115.17
7.2.240.0040.01114.72
7.2.230.0070.01115.37
7.2.220.0070.00715.06
7.2.210.0060.00615.27
7.2.200.0060.01215.34
7.2.190.0120.00315.23
7.2.180.0050.01014.99
7.2.170.0120.00415.14
7.2.160.0030.01315.34
7.2.150.0000.01117.17
7.2.140.0060.00617.23
7.2.130.0110.00417.09
7.2.120.0000.01517.14
7.2.110.0070.00716.82
7.2.100.0040.01117.24
7.2.90.0070.00416.91
7.2.80.0070.01016.99
7.2.70.0060.00917.07
7.2.60.0260.00315.92
7.2.50.0330.00716.11
7.2.40.0180.01316.21
7.2.30.0250.01016.15
7.2.20.0350.00715.96
7.2.10.0250.00815.79
7.2.00.0250.01216.01
7.1.330.0100.00315.89
7.1.320.0030.01415.82
7.1.310.0000.01515.84
7.1.300.0040.01115.72
7.1.290.0070.00415.98
7.1.280.0060.00915.92
7.1.270.0030.01015.92
7.1.260.0100.00015.85
7.1.250.0040.00815.80
7.1.240.0030.01115.85
7.1.230.0080.00315.98
7.1.220.0030.01015.93
7.1.210.0060.00615.87
7.1.200.0020.01315.90
7.1.190.0110.00715.70
7.1.180.0040.00815.77
7.1.170.0260.00514.81
7.1.160.0220.00714.81
7.1.150.0270.00715.06
7.1.140.0330.00814.88
7.1.130.0200.00914.84
7.1.120.0140.01514.63
7.1.110.0270.01014.77
7.1.100.0260.00514.95
7.1.90.0230.01014.77
7.1.80.0340.00614.83
7.1.70.0300.00914.94
7.1.60.0360.00923.52
7.1.50.0330.01423.56
7.1.40.0390.01123.78
7.1.30.0430.00823.78
7.1.20.0480.01423.78
7.1.10.0300.01014.94
7.1.00.0240.00914.69
7.0.330.0060.00615.39
7.0.320.0000.01015.59
7.0.310.0000.00915.48
7.0.300.0090.00615.50
7.0.290.0000.01015.52
7.0.280.0100.00315.68
7.0.270.0080.00615.35
7.0.260.0060.00315.30
7.0.250.0060.00615.54
7.0.240.0030.00915.64
7.0.230.0000.01515.75
7.0.220.0070.00715.66
7.0.210.0100.00715.61
7.0.200.0000.01215.52
7.0.190.0060.00915.73
7.0.180.0100.00715.41
7.0.170.0060.00315.44
7.0.160.0000.00915.36
7.0.150.0070.00415.38
7.0.140.0060.00915.67
7.0.130.0030.00615.57
7.0.120.0030.00715.59
7.0.110.0000.00915.46
7.0.100.0110.00315.48
7.0.90.0060.00615.64
7.0.80.0030.00715.73
7.0.70.0070.00415.75
7.0.60.0090.00615.52
7.0.50.0130.00015.76
7.0.40.0040.00713.56
7.0.30.0040.00413.55
7.0.20.0070.00713.44
7.0.10.0000.01113.65
7.0.00.0050.00613.68
5.6.400.0030.01014.41
5.6.390.0090.00614.47
5.6.380.0050.00514.24
5.6.370.0060.00914.57
5.6.360.0040.01114.63
5.6.350.0030.00714.57
5.6.340.0030.01014.46
5.6.330.0100.00714.31
5.6.320.0070.00314.09
5.6.310.0060.00614.74
5.6.300.0070.00314.63
5.6.290.0060.00914.44
5.6.280.0040.00814.91
5.6.270.0090.00614.29
5.6.260.0060.00314.47
5.6.250.0060.00614.49
5.6.240.0060.00914.38
5.6.230.0130.00314.46
5.6.220.0090.00614.93
5.6.210.0000.01514.34
5.6.200.0040.01214.53
5.6.190.0060.00314.53
5.6.180.0030.01014.56
5.6.170.0090.00614.27
5.6.160.0030.00914.48
5.6.150.0040.00714.45
5.6.140.0080.00814.52
5.6.130.0060.01014.51
5.6.120.0070.00714.47
5.6.110.0120.00314.43
5.6.100.0070.00714.78
5.6.90.0030.01014.72
5.6.80.0030.00914.37
5.6.70.0100.00714.46
5.6.60.0040.01114.28
5.6.50.0060.01014.44
5.6.40.0000.01514.35
5.6.30.0060.00614.21
5.6.20.0090.00614.39
5.6.10.0130.00314.54
5.6.00.0040.00414.73

preferences:
53.66 ms | 400 KiB | 5 Q