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->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.70.0070.00717.00
8.3.60.0090.00618.56
8.3.50.0070.00718.41
8.3.40.0120.00818.82
8.3.30.0070.00718.96
8.3.20.0040.00419.40
8.3.10.0060.00619.45
8.3.00.0050.00323.76
8.2.190.0170.00017.00
8.2.180.0180.00316.47
8.2.170.0120.00322.96
8.2.160.0110.00422.38
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0030.00619.89
8.2.120.0040.00426.35
8.2.110.0100.00021.12
8.2.100.0080.00318.16
8.2.90.0030.00618.28
8.2.80.0040.00418.05
8.2.70.0080.00318.18
8.2.60.0050.00318.18
8.2.50.0040.00418.10
8.2.40.0040.00419.64
8.2.30.0000.00719.75
8.2.20.0090.00018.23
8.2.10.0040.00418.39
8.2.00.0000.00719.70
8.1.280.0120.00325.92
8.1.270.0030.00623.99
8.1.260.0030.00526.35
8.1.250.0000.00828.09
8.1.240.0090.00020.81
8.1.230.0070.00422.36
8.1.220.0000.00817.89
8.1.210.0030.00619.02
8.1.200.0040.00417.48
8.1.190.0060.00317.34
8.1.180.0000.00818.10
8.1.170.0000.00818.90
8.1.160.0040.00419.00
8.1.150.0040.00419.14
8.1.140.0040.00417.98
8.1.130.0000.00719.23
8.1.120.0000.00717.75
8.1.110.0040.00417.57
8.1.100.0060.00317.74
8.1.90.0000.00717.64
8.1.80.0040.00417.55
8.1.70.0080.00017.68
8.1.60.0030.00617.79
8.1.50.0030.00617.63
8.1.40.0000.00817.82
8.1.30.0030.00517.85
8.1.20.0030.00517.89
8.1.10.0040.00417.84
8.1.00.0000.00817.57
8.0.300.0040.00420.13
8.0.290.0000.00716.88
8.0.280.0000.00718.56
8.0.270.0030.00317.45
8.0.260.0040.00417.53
8.0.250.0030.00317.20
8.0.240.0000.00717.12
8.0.230.0000.00817.13
8.0.220.0000.00717.04
8.0.210.0000.00717.10
8.0.200.0030.00317.04
8.0.190.0040.00417.01
8.0.180.0030.00617.20
8.0.170.0040.00417.04
8.0.160.0040.00417.16
8.0.150.0040.00417.07
8.0.140.0070.00017.18
8.0.130.0030.00313.62
8.0.120.0030.00516.96
8.0.110.0000.00717.18
8.0.100.0080.00017.01
8.0.90.0000.00717.22
8.0.80.0020.01316.99
8.0.70.0040.00417.07
8.0.60.0050.00217.02
8.0.50.0050.00216.93
8.0.30.0080.01017.27
8.0.20.0170.00317.40
8.0.10.0040.00417.23
8.0.00.0110.00717.11
7.4.330.0060.00015.55
7.4.320.0030.00316.82
7.4.300.0000.00616.75
7.4.290.0030.00316.68
7.4.280.0040.00416.81
7.4.270.0040.00416.58
7.4.260.0030.00316.65
7.4.250.0000.00816.75
7.4.240.0030.00316.84
7.4.230.0000.00816.49
7.4.220.0050.00316.52
7.4.210.0070.01016.74
7.4.200.0040.00316.84
7.4.160.0120.00516.71
7.4.140.0120.01017.86
7.4.130.0100.00816.54
7.4.120.0120.00816.73
7.4.110.0080.01516.76
7.4.100.0080.01216.68
7.4.90.0080.00816.90
7.4.80.0100.01219.39
7.4.70.0090.01116.65
7.4.60.0110.00516.56
7.4.50.0070.00716.81
7.4.40.0090.01216.82
7.4.00.0030.01414.80
7.3.330.0000.00613.29
7.3.320.0060.00013.33
7.3.310.0070.00016.60
7.3.300.0060.00016.40
7.3.290.0030.00316.38
7.3.280.0090.00916.43
7.3.260.0080.01116.55
7.3.240.0090.00816.64
7.3.230.0030.01316.54
7.3.210.0070.01116.36
7.3.200.0070.01016.46
7.3.190.0090.00816.51
7.3.180.0040.01116.73
7.3.170.0040.01316.48
7.3.160.0080.00816.42
7.2.330.0120.00917.00
7.2.320.0110.00717.01
7.2.310.0080.01716.82
7.2.300.0110.00616.73
7.2.290.0190.00317.02
7.2.60.0420.00914.58
7.2.50.0410.01714.97
7.2.40.0490.00315.07
7.2.30.0530.01315.06
7.2.20.0690.01014.80
7.2.10.0450.00614.95
7.2.00.0540.00615.20
7.1.200.0030.00915.88
7.1.170.0540.00913.38
7.1.160.0420.01013.60
7.1.150.0480.00013.55
7.1.140.0600.01113.90
7.1.130.0420.01213.77
7.1.120.0450.00613.79
7.1.110.0470.00913.72
7.1.100.0630.01313.84
7.1.90.0510.00713.73
7.1.80.0580.00313.72
7.1.70.1310.00613.67
7.1.60.0710.00331.72
7.1.50.0730.00931.58
7.1.40.0660.01631.89
7.1.30.0680.01331.41
7.1.20.0950.01031.46
7.1.10.0690.00613.41
7.1.00.0560.00913.83

preferences:
39.59 ms | 401 KiB | 5 Q