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); var_dump($namespaces); $yt = $item->children($namespaces['yt']); $seconds = $yt->duration->attributes(); echo $seconds['seconds'], "\n"; // original comment: but doesn't work. } $test = array("yt:second" => 124); var_dump($test); 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.0040.01116.75
8.3.60.0200.00018.68
8.3.50.0120.00722.11
8.3.40.0040.01119.00
8.3.30.0070.00720.46
8.3.20.0080.00018.95
8.3.10.0060.00321.39
8.3.00.0080.00019.81
8.2.180.0120.00618.43
8.2.170.0170.00322.96
8.2.160.0070.00722.42
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0050.00326.16
8.2.120.0050.00321.32
8.2.110.0060.01220.60
8.2.100.0030.00918.03
8.2.90.0000.00819.42
8.2.80.0040.00419.46
8.2.70.0030.00617.88
8.2.60.0090.00018.29
8.2.50.0050.00318.07
8.2.40.0000.00818.41
8.2.30.0030.00719.62
8.2.20.0040.00417.93
8.2.10.0040.00417.95
8.2.00.0040.00418.00
8.1.280.0110.00725.92
8.1.270.0040.00423.99
8.1.260.0030.00626.35
8.1.250.0040.00428.09
8.1.240.0030.00622.78
8.1.230.0000.01121.19
8.1.220.0000.00818.77
8.1.210.0040.00419.18
8.1.200.0030.00617.47
8.1.190.0050.00317.68
8.1.180.0000.00818.10
8.1.170.0040.00418.84
8.1.160.0040.00419.13
8.1.150.0040.00418.88
8.1.140.0040.00417.63
8.1.130.0040.00418.06
8.1.120.0070.00017.75
8.1.110.0090.00017.57
8.1.100.0000.00717.59
8.1.90.0050.00317.66
8.1.80.0000.00717.58
8.1.70.0000.00717.57
8.1.60.0050.00317.71
8.1.50.0080.00017.63
8.1.40.0040.00417.80
8.1.30.0000.00817.80
8.1.20.0040.00417.84
8.1.10.0030.00517.87
8.1.00.0000.01017.59
8.0.300.0040.00420.12
8.0.290.0070.00017.30
8.0.280.0000.00718.72
8.0.270.0040.00317.46
8.0.260.0050.00217.11
8.0.250.0040.00417.09
8.0.240.0030.00517.21
8.0.230.0030.00317.16
8.0.220.0030.00417.16
8.0.210.0050.00317.21
8.0.200.0000.00717.07
8.0.190.0030.00517.12
8.0.180.0040.00417.20
8.0.170.0030.00617.11
8.0.160.0030.00617.11
8.0.150.0050.00216.98
8.0.140.0000.00817.14
8.0.130.0060.00013.57
8.0.120.0080.00017.11
8.0.110.0050.00317.07
8.0.100.0030.00517.23
8.0.90.0040.00417.00
8.0.80.0070.01017.06
8.0.70.0040.00417.10
8.0.60.0000.00817.14
8.0.50.0040.00417.01
8.0.30.0080.01117.47
8.0.20.0030.01617.40
8.0.10.0080.00017.11
8.0.00.0110.01017.00
7.4.330.0050.00016.94
7.4.320.0000.00616.85
7.4.300.0000.00616.83
7.4.290.0040.00416.93
7.4.280.0040.00416.71
7.4.270.0070.00016.75
7.4.260.0050.00013.45
7.4.250.0040.00416.80
7.4.240.0040.00416.80
7.4.230.0080.00016.86
7.4.220.0060.01516.75
7.4.210.0080.00916.79
7.4.200.0000.00716.64
7.4.190.0000.00716.91
7.4.160.0140.00316.76
7.4.150.0120.00617.40
7.4.140.0080.01217.86
7.4.130.0090.00816.71
7.4.120.0050.01216.70
7.4.110.0090.01216.72
7.4.100.0120.00916.66
7.4.90.0130.00716.84
7.4.80.0090.01119.39
7.4.70.0100.00716.64
7.4.60.0060.01216.82
7.4.50.0030.00616.41
7.4.40.0050.00822.77
7.4.30.0200.00316.76
7.4.00.0090.00615.10
7.3.330.0060.00013.16
7.3.320.0030.00313.36
7.3.310.0040.00316.62
7.3.300.0030.00316.48
7.3.290.0040.01116.49
7.3.280.0090.00516.47
7.3.270.0120.00617.40
7.3.260.0100.01218.24
7.3.250.0150.00316.73
7.3.240.0170.00016.55
7.3.230.0060.01316.63
7.3.210.0040.01416.49
7.3.200.0090.00919.39
7.3.190.0090.00916.46
7.3.180.0080.00816.72
7.3.170.0110.00616.71
7.3.160.0000.01716.51
7.3.120.0080.00916.10
7.3.110.0090.00715.92
7.3.100.0100.00516.13
7.3.90.0090.00816.13
7.3.80.0030.01215.97
7.3.70.0070.00716.06
7.3.60.0050.00515.89
7.3.50.0000.01316.11
7.3.40.0050.00916.05
7.3.30.0090.00616.00
7.3.20.0060.00816.94
7.3.10.0050.00916.81
7.3.00.0050.00616.83
7.2.330.0090.01216.98
7.2.320.0120.01217.02
7.2.310.0140.00316.97
7.2.300.0100.00616.81
7.2.290.0060.01217.01
7.2.250.0070.01315.00
7.2.240.0080.01116.02
7.2.230.0050.01016.27
7.2.220.0060.00916.18
7.2.210.0030.01416.15
7.2.200.0090.00316.22
7.2.190.0070.00916.14
7.2.180.0050.01016.18
7.2.170.0060.00916.22
7.2.160.0060.01017.15
7.2.150.0070.00717.33
7.2.140.0070.01017.15
7.2.130.0080.00717.21
7.2.120.0050.00917.07
7.2.110.0070.00917.09
7.2.100.0040.00917.13
7.2.90.0030.01117.04
7.2.80.0060.00717.02
7.2.70.0090.00717.11
7.2.60.0040.01017.11
7.2.50.0050.00717.13
7.2.40.0060.01017.13
7.2.30.0000.01317.08
7.2.20.0080.00617.13
7.2.10.0080.00817.20
7.2.00.0070.00718.02
7.1.330.0090.00616.42
7.1.320.0090.00516.59
7.1.310.0070.00616.48
7.1.300.0020.01416.50
7.1.290.0030.00816.55
7.1.280.0050.00916.56
7.1.270.0080.00816.53
7.1.260.0050.00716.59
7.1.250.0040.01016.46
7.1.200.0040.01116.11
7.1.100.0060.01018.13
7.1.70.0030.00617.26
7.1.60.0030.00717.36
7.1.50.0100.00616.83
7.1.40.0080.00816.59
7.1.30.0070.00716.68
7.1.20.0000.01416.76
7.1.10.0060.00316.61
7.1.00.0090.00916.79
7.0.200.0000.00816.88
7.0.190.0030.01016.53
7.0.180.0030.00516.43
7.0.170.0020.00516.26
7.0.160.0000.00716.38
7.0.150.0000.00816.51
7.0.140.0030.01016.50
7.0.130.0000.00816.80
7.0.120.0000.00716.62
7.0.110.0030.00516.58
7.0.100.0050.00516.39
7.0.90.0030.01016.66
7.0.80.0050.00316.36
7.0.70.0000.01216.55
7.0.60.0000.00916.07
7.0.50.0030.01316.30
7.0.40.0040.00815.58
7.0.30.0000.00715.58
7.0.20.0030.00615.58
7.0.10.0080.00015.58
7.0.00.0040.00815.58
5.6.300.0030.04820.83
5.6.290.0140.05120.96
5.6.280.0100.05321.02
5.6.270.0000.07620.89
5.6.260.0030.04720.87
5.6.250.0070.06621.03
5.6.240.0100.08220.94
5.6.230.0070.04621.12
5.6.220.0000.04520.86
5.6.210.0030.07221.02
5.6.200.0070.04320.70
5.6.190.0000.04520.98
5.6.180.0100.06520.88
5.6.170.0030.04220.95
5.6.160.0070.07520.84
5.6.150.0100.03621.00
5.6.140.0070.05620.98
5.6.130.0000.04720.81
5.6.120.0070.04320.91
5.6.110.0030.04420.81
5.6.100.0000.05020.83
5.6.90.0030.06421.00
5.6.80.0100.03620.38
5.6.70.0030.03920.21
5.6.60.0030.04120.27
5.6.50.0030.07020.36
5.6.40.0000.04220.34
5.6.30.0000.04820.20
5.6.20.0030.08420.34
5.6.10.0030.07520.21
5.6.00.0000.05520.19
5.5.380.0070.03717.57
5.5.370.0000.08417.51
5.5.360.0000.08417.75
5.5.350.0030.04117.50
5.5.340.0030.07418.10
5.5.330.0030.04518.08
5.5.320.0100.06318.06
5.5.310.0030.08018.09
5.5.300.0070.04718.07
5.5.290.0030.04418.09
5.5.280.0070.04218.06
5.5.270.0000.04918.07
5.5.260.0000.06018.02
5.5.250.0030.08817.72
5.5.240.0060.03517.48
5.5.230.0000.04317.30
5.5.220.0030.03917.43
5.5.210.0040.03917.46
5.5.200.0030.04317.45
5.5.190.0060.07117.43
5.5.180.0030.07017.43
5.5.160.0030.04017.48
5.5.150.0100.07617.26
5.5.140.0100.05317.41
5.5.130.0000.04817.43
5.5.120.0000.04617.45
5.5.110.0030.03917.44
5.5.100.0000.05317.33
5.5.90.0000.08417.29
5.5.80.0030.03817.25
5.5.70.0030.04517.34
5.5.60.0000.04117.13
5.5.50.0100.05317.16
5.5.40.0030.06017.29
5.5.30.0030.03617.29
5.5.20.0030.03917.11
5.5.10.0000.04117.33
5.5.00.0030.04217.27
5.4.450.0030.05019.39
5.4.440.0040.04219.29
5.4.430.0000.04319.53
5.4.420.0070.04719.29
5.4.410.0030.05119.42
5.4.400.0000.04119.07
5.4.390.0130.03219.09
5.4.380.0000.04219.10
5.4.370.0060.04518.96
5.4.360.0060.05518.99
5.4.350.0030.04119.20
5.4.340.0060.03419.12
5.4.320.0100.06919.22
5.4.310.0000.04218.99
5.4.300.0070.03319.21
5.4.290.0030.03719.11
5.4.280.0030.06018.99
5.4.270.0000.08119.09
5.4.260.0030.04019.22
5.4.250.0030.07718.93
5.4.240.0030.08019.09
5.4.230.0040.03619.17
5.4.220.0100.03119.21
5.4.210.0000.04119.01
5.4.200.0030.04319.18
5.4.190.0060.05519.09
5.4.180.0000.05019.02
5.4.170.0000.04619.05
5.4.160.0000.04519.09
5.4.150.0030.03819.04
5.4.140.0000.03816.52
5.4.130.0030.03316.77
5.4.120.0030.03416.82
5.4.110.0070.03116.72
5.4.100.0070.03116.63
5.4.90.0000.04116.71
5.4.80.0000.03916.66
5.4.70.0000.03816.50
5.4.60.0040.03916.78
5.4.50.0000.03716.59
5.4.40.0070.03016.69
5.4.30.0000.03616.42
5.4.20.0030.03316.48
5.4.10.0030.03716.42
5.4.00.0100.04716.12
5.3.290.0030.09315.58
5.3.280.0000.06415.58
5.3.270.0030.03615.58
5.3.260.0070.03215.58
5.3.250.0000.03815.58
5.3.240.0000.04215.58
5.3.230.0070.03115.58
5.3.220.0030.03515.58
5.3.210.0000.04115.58
5.3.200.0030.06115.58
5.3.190.0000.03915.58
5.3.180.0030.03515.58
5.3.170.0000.04115.58
5.3.160.0100.04015.58
5.3.150.0030.04215.58
5.3.140.0060.03515.58
5.3.130.0030.03715.58
5.3.120.0000.04115.58
5.3.110.0030.03815.58
5.3.100.0070.04615.58
5.3.90.0000.04115.58
5.3.80.0000.05415.58
5.3.70.0060.05115.58
5.3.60.0100.02915.58
5.3.50.0060.05115.58
5.3.40.0000.03715.58
5.3.30.0060.03415.58
5.3.20.0070.03015.58
5.3.10.0030.03215.58
5.3.00.0040.04215.58
5.2.170.0040.03215.58
5.2.160.0070.03515.58
5.2.150.0000.03515.58
5.2.140.0000.04215.58
5.2.130.0030.02615.58
5.2.120.0000.05415.58
5.2.110.0000.02915.58
5.2.100.0030.03215.58
5.2.90.0030.02915.58
5.2.80.0140.02815.58
5.2.70.0070.02415.58
5.2.60.0030.02815.58
5.2.50.0070.02915.58
5.2.40.0030.02715.58
5.2.30.0030.02715.58
5.2.20.0030.05815.58
5.2.10.0070.02415.58
5.2.00.0070.02415.58
5.1.60.0030.02415.58
5.1.50.0070.02315.58
5.1.40.0000.02715.58
5.1.30.0000.02915.58
5.1.20.0030.02815.58
5.1.10.0030.02415.58
5.1.00.0000.03015.58
5.0.50.0030.02315.58
5.0.40.0000.02115.58
5.0.30.0000.03415.58
5.0.20.0060.01515.58
5.0.10.0030.03115.58
5.0.00.0000.04215.58
4.4.90.0030.01415.58
4.4.80.0000.01815.58
4.4.70.0030.01515.58
4.4.60.0000.02815.58
4.4.50.0040.01815.58
4.4.40.0000.02615.58
4.4.30.0030.01515.58
4.4.20.0060.01215.58
4.4.10.0040.01215.58
4.4.00.0000.02715.58
4.3.110.0030.01315.58
4.3.100.0000.01915.58
4.3.90.0000.03115.58
4.3.80.0000.04615.58
4.3.70.0000.01715.58
4.3.60.0000.01715.58
4.3.50.0000.01615.58
4.3.40.0070.02615.58
4.3.30.0030.03015.58
4.3.20.0100.01915.58
4.3.10.0000.01815.58
4.3.00.0000.01615.58

preferences:
45.72 ms | 401 KiB | 5 Q