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['seconds']; 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.0070.00718.56
8.3.50.0060.00918.32
8.3.40.0040.01119.22
8.3.30.0070.01019.07
8.3.20.0080.00019.21
8.3.10.0070.00419.35
8.3.00.0090.00023.91
8.2.180.0170.00316.88
8.2.170.0070.00722.96
8.2.160.0110.00422.23
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0090.00018.46
8.2.120.0040.00426.35
8.2.110.0060.00321.17
8.2.100.0090.00318.16
8.2.90.0080.00018.15
8.2.80.0070.00418.15
8.2.70.0000.00818.18
8.2.60.0000.00818.18
8.2.50.0000.00818.10
8.2.40.0000.00719.67
8.2.30.0020.00519.62
8.2.20.0070.00318.23
8.2.10.0050.00318.38
8.2.00.0000.00719.69
8.1.280.0070.01025.92
8.1.270.0070.00020.57
8.1.260.0090.00026.35
8.1.250.0080.00028.09
8.1.240.0060.00322.72
8.1.230.0130.00321.18
8.1.220.0040.00418.04
8.1.210.0000.00919.18
8.1.200.0000.00817.60
8.1.190.0080.00017.35
8.1.180.0040.00418.10
8.1.170.0040.00418.89
8.1.160.0000.00819.02
8.1.150.0000.00719.06
8.1.140.0000.00717.90
8.1.130.0000.00719.14
8.1.120.0050.00317.60
8.1.110.0030.00717.79
8.1.100.0030.00517.64
8.1.90.0000.00717.72
8.1.80.0040.00417.58
8.1.70.0040.00417.78
8.1.60.0050.00317.89
8.1.50.0000.00717.57
8.1.40.0000.00817.60
8.1.30.0030.00617.76
8.1.20.0050.00317.95
8.1.10.0050.00317.83
8.1.00.0060.00317.57
8.0.300.0050.00320.07
8.0.290.0060.00316.88
8.0.280.0030.00318.66
8.0.270.0000.00817.48
8.0.260.0040.00417.49
8.0.250.0000.00717.15
8.0.240.0030.00317.09
8.0.230.0000.00717.13
8.0.220.0000.00917.18
8.0.210.0000.00717.05
8.0.200.0000.00717.04
8.0.190.0000.00917.19
8.0.180.0040.00417.12
8.0.170.0030.00617.03
8.0.160.0000.00817.05
8.0.150.0080.00016.93
8.0.140.0040.00417.05
8.0.130.0000.00513.55
8.0.120.0040.00416.98
8.0.110.0040.00417.00
8.0.100.0040.00417.05
8.0.90.0000.00717.15
8.0.80.0060.01317.20
8.0.70.0070.00016.96
8.0.60.0000.00716.97
8.0.50.0080.00017.21
8.0.30.0110.01017.40
8.0.20.0150.00517.40
8.0.10.0040.00417.26
8.0.00.0070.01216.93
7.4.330.0040.00415.55
7.4.320.0000.00616.72
7.4.300.0030.00316.79
7.4.290.0070.00016.73
7.4.280.0040.00416.84
7.4.270.0050.00316.77
7.4.260.0020.00516.79
7.4.250.0000.01016.73
7.4.240.0060.00316.68
7.4.230.0030.00316.60
7.4.220.0060.00316.76
7.4.210.0170.01816.74
7.4.200.0000.00716.84
7.4.160.0090.00916.72
7.4.140.0110.00917.86
7.4.130.0070.01116.77
7.4.120.0100.01116.72
7.4.110.0130.00416.52
7.4.100.0080.01416.80
7.4.90.0070.01016.77
7.4.80.0030.01619.39
7.4.70.0130.00616.80
7.4.60.0030.01416.54
7.4.50.0060.00916.63
7.4.40.0160.00816.80
7.4.00.0040.01415.36
7.3.330.0030.00313.31
7.3.320.0050.00013.43
7.3.310.0030.00316.52
7.3.300.0040.00416.52
7.3.290.0000.00616.56
7.3.280.0100.01016.43
7.3.260.0130.00716.73
7.3.240.0060.01016.58
7.3.230.0110.01116.56
7.3.210.0140.00316.82
7.3.200.0070.01616.86
7.3.190.0160.00316.72
7.3.180.0130.00316.30
7.3.170.0030.01316.60
7.3.160.0120.00316.69
7.3.120.0040.01215.00
7.3.110.0120.00315.11
7.3.100.0040.01214.83
7.3.90.0090.00614.75
7.3.80.0150.00014.59
7.3.70.0060.01214.80
7.3.60.0040.01114.81
7.3.50.0060.00914.88
7.3.40.0030.00614.62
7.3.30.0030.01214.87
7.3.20.0060.00616.53
7.3.10.0140.00316.77
7.3.00.0060.00916.61
7.2.330.0130.00717.03
7.2.320.0070.01816.75
7.2.310.0060.01716.82
7.2.300.0040.01817.00
7.2.290.0180.00616.86
7.2.240.0160.00015.35
7.2.230.0100.00715.29
7.2.220.0110.00415.16
7.2.210.0030.01015.14
7.2.200.0070.00415.22
7.2.190.0110.00415.18
7.2.180.0060.01015.08
7.2.170.0090.00615.15
7.2.160.0100.00715.02
7.2.150.0090.00917.09
7.2.140.0030.01017.08
7.2.130.0030.01017.27
7.2.120.0060.00617.21
7.2.110.0110.00716.85
7.2.100.0040.01517.27
7.2.90.0100.00317.23
7.2.80.0030.01417.02
7.2.70.0180.00016.99
7.2.60.0180.00816.04
7.2.50.0250.00916.05
7.2.40.0260.00615.93
7.2.30.0220.01116.21
7.2.20.0360.00816.13
7.2.10.0170.01016.07
7.2.00.0200.00616.00
7.1.330.0030.01015.75
7.1.320.0110.00415.70
7.1.310.0000.01115.97
7.1.300.0080.00315.57
7.1.290.0060.00915.89
7.1.280.0040.00715.80
7.1.270.0070.00715.72
7.1.260.0080.00816.13
7.1.250.0030.01015.83
7.1.200.0040.01115.71
7.1.170.0320.01214.01
7.1.160.0320.01313.88
7.1.150.0410.00913.78
7.1.140.0330.01614.06
7.1.130.0290.00713.57
7.1.120.0430.00613.98
7.1.110.0280.00813.84
7.1.100.0310.00513.60
7.1.90.0370.00413.90
7.1.80.0340.00613.95
7.1.70.0420.00314.15
7.1.60.0510.02131.80
7.1.50.0560.01231.67
7.1.40.0620.00331.71
7.1.30.0530.01032.02
7.1.20.0600.01032.02
7.1.10.0660.00313.86
7.1.00.0390.00913.88

preferences:
64.5 ms | 400 KiB | 5 Q