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); print_r($xml); echo "ibxml version: ", LIBXML_DOTTED_VERSION, "\n"; echo $xml->entry->duration; 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.0150.00018.68
8.3.50.0090.00618.31
8.3.40.0120.00319.08
8.3.30.0140.00018.96
8.3.20.0040.00419.45
8.3.10.0030.01019.40
8.3.00.0040.00423.77
8.2.180.0170.01316.63
8.2.170.0150.00022.96
8.2.160.0110.00822.24
8.2.150.0050.00324.18
8.2.140.0030.00524.66
8.2.130.0060.00320.08
8.2.120.0040.00426.35
8.2.110.0100.00021.04
8.2.100.0040.00818.03
8.2.90.0050.00318.09
8.2.80.0110.00418.14
8.2.70.0050.00318.28
8.2.60.0000.00818.18
8.2.50.0030.00518.10
8.2.40.0050.00319.57
8.2.30.0000.00719.75
8.2.20.0060.00318.24
8.2.10.0040.00418.23
8.2.00.0030.00319.79
8.1.280.0060.00825.92
8.1.270.0070.00020.48
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0070.00322.63
8.1.230.0030.01021.10
8.1.220.0050.00317.89
8.1.210.0000.00819.16
8.1.200.0050.00517.60
8.1.190.0060.00317.35
8.1.180.0040.00418.10
8.1.170.0030.00618.95
8.1.160.0050.00219.06
8.1.150.0000.00719.05
8.1.140.0040.00417.99
8.1.130.0030.00319.14
8.1.120.0040.00417.77
8.1.110.0030.00717.74
8.1.100.0090.00017.71
8.1.90.0000.00717.57
8.1.80.0000.00817.78
8.1.70.0030.00617.73
8.1.60.0050.00317.81
8.1.50.0030.00517.78
8.1.40.0080.00017.82
8.1.30.0040.00417.76
8.1.20.0030.00617.93
8.1.10.0080.00017.75
8.1.00.0000.00917.73
8.0.300.0040.00420.23
8.0.290.0040.00416.88
8.0.280.0000.00718.63
8.0.270.0000.00717.43
8.0.260.0000.00717.54
8.0.250.0000.00717.09
8.0.240.0030.00317.14
8.0.230.0040.00417.03
8.0.220.0030.00517.18
8.0.210.0070.00017.19
8.0.200.0070.00017.24
8.0.190.0000.00917.20
8.0.180.0000.00717.10
8.0.170.0030.00616.98
8.0.160.0040.00417.20
8.0.150.0040.00417.09
8.0.140.0000.00716.97
8.0.130.0000.00613.49
8.0.120.0060.00317.10
8.0.110.0070.00017.06
8.0.100.0080.00017.11
8.0.90.0070.00017.17
8.0.80.0050.01417.09
8.0.70.0040.00416.99
8.0.60.0000.00717.17
8.0.50.0040.00417.19
8.0.30.0110.00617.45
8.0.20.0140.00717.40
8.0.10.0000.00817.29
8.0.00.0130.00817.11
7.4.330.0070.00015.55
7.4.320.0060.00016.68
7.4.300.0060.00016.66
7.4.290.0000.00616.81
7.4.280.0040.00416.73
7.4.270.0030.00616.60
7.4.260.0040.00416.63
7.4.250.0000.00816.71
7.4.240.0070.00016.76
7.4.230.0000.00716.66
7.4.220.0030.00516.88
7.4.210.0050.01316.80
7.4.200.0030.00316.86
7.4.160.0090.01016.68
7.4.140.0120.00817.86
7.4.130.0130.00416.80
7.4.120.0140.00616.72
7.4.110.0100.00716.68
7.4.100.0090.01316.77
7.4.90.0140.00316.60
7.4.80.0180.00419.39
7.4.70.0150.00616.76
7.4.60.0060.01916.69
7.4.50.0000.01616.70
7.4.40.0100.01316.76
7.4.00.0030.01215.00
7.3.330.0000.00513.30
7.3.320.0030.00313.32
7.3.310.0030.00316.41
7.3.300.0070.00016.50
7.3.290.0070.00016.49
7.3.280.0070.00716.54
7.3.260.0110.00916.71
7.3.240.0070.01016.66
7.3.230.0100.00716.62
7.3.210.0070.01016.54
7.3.200.0100.01316.42
7.3.190.0080.00816.55
7.3.180.0130.00316.36
7.3.170.0090.01016.79
7.3.160.0060.00916.50
7.3.120.0040.01117.15
7.3.110.0090.00617.15
7.3.100.0040.01417.15
7.3.90.0000.01017.15
7.3.80.0070.00717.15
7.3.70.0060.00617.15
7.3.60.0130.00017.15
7.3.50.0000.01617.15
7.3.40.0030.01217.15
7.3.30.0090.00617.15
7.3.20.0130.00017.15
7.3.10.0090.00616.88
7.3.00.0050.00916.85
7.2.330.0090.01216.55
7.2.320.0090.00917.03
7.2.310.0090.00916.72
7.2.300.0060.01216.88
7.2.290.0120.01216.65
7.2.240.0140.00017.15
7.2.230.0060.00917.15
7.2.220.0030.01417.15
7.2.210.0130.00317.15
7.2.200.0070.01117.15
7.2.190.0060.00617.15
7.2.180.0100.00617.15
7.2.170.0030.00917.15
7.2.160.0030.00717.15
7.2.150.0070.00717.15
7.2.140.0040.01117.22
7.2.130.0100.00317.04
7.2.120.0020.01217.04
7.2.110.0040.00917.13
7.2.100.0050.01017.03
7.2.90.0050.00817.14
7.2.80.0050.00717.14
7.2.70.0040.00717.13
7.2.60.0120.01116.46
7.2.50.0130.00916.45
7.2.40.0060.00816.43
7.2.30.0200.00716.50
7.2.20.0080.00716.43
7.2.10.0050.01116.35
7.2.00.0190.01116.44
7.1.330.0120.00617.15
7.1.320.0040.01217.15
7.1.310.0070.00317.15
7.1.300.0040.01117.15
7.1.290.0040.01117.15
7.1.280.0090.00617.15
7.1.270.0100.00717.15
7.1.260.0060.01017.15
7.1.250.0040.00916.47
7.1.200.0070.00315.61
7.1.170.0510.00713.70
7.1.160.0460.00213.74
7.1.150.0090.00613.72
7.1.140.0340.00613.75
7.1.130.0060.01513.46
7.1.120.0280.00313.86
7.1.110.0080.00913.91
7.1.100.0290.00314.11
7.1.90.0650.00913.68
7.1.80.0340.01313.74
7.1.70.0280.01214.05
7.1.60.0570.01131.61
7.1.50.0550.00931.79
7.1.40.0440.00931.97
7.1.30.0460.01931.81
7.1.20.0300.00631.98
7.1.10.0370.00713.99
7.1.00.0610.00313.93

preferences:
36.16 ms | 400 KiB | 5 Q