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> <duration seconds="1870" yt:seconds="0 in yt namespace" /> </entry> </feed>'; $xml = new SimpleXMLElement($buffer); if (!defined('LIBXML_DOTTED_VERSION')) { echo "PHP/LIBXML unsupported/too old."; return; } echo "ibxml version: ", LIBXML_DOTTED_VERSION, "\n"; $youtube = $xml; echo 'via attributes(): ', $youtube->entry->duration->children('yt', TRUE)->attributes()->seconds, "\n"; echo 'via array-access: ', $youtube->entry->duration->children('yt', TRUE)['seconds'], "\n"; echo 'via property : ', $youtube->entry->duration->children('yt', TRUE)->seconds, "\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.0130.00616.75
8.3.50.0140.00721.20
8.3.40.0090.00618.93
8.3.30.0030.01418.95
8.3.20.0040.00420.27
8.3.10.0040.00423.86
8.3.00.0140.00022.65
8.2.180.0090.00617.13
8.2.170.0120.00322.96
8.2.160.0100.00322.33
8.2.150.0090.00024.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0050.00518.00
8.2.110.0060.00320.72
8.2.100.0080.00418.16
8.2.90.0000.00818.59
8.2.80.0030.00517.97
8.2.70.0030.00617.75
8.2.60.0030.00618.05
8.2.50.0000.00818.07
8.2.40.0030.00621.21
8.2.30.0000.00820.12
8.2.20.0040.00417.92
8.2.10.0040.00418.31
8.2.00.0040.00418.23
8.1.280.0100.00325.92
8.1.270.0060.00320.50
8.1.260.0080.00026.35
8.1.250.0070.00028.09
8.1.240.0080.00022.45
8.1.230.0040.00721.20
8.1.220.0050.00317.93
8.1.210.0000.00818.77
8.1.200.0070.00317.47
8.1.190.0000.00717.48
8.1.180.0040.00418.10
8.1.170.0040.00418.78
8.1.160.0050.00322.18
8.1.150.0070.00019.07
8.1.140.0040.00417.66
8.1.130.0030.00317.87
8.1.120.0070.00017.45
8.1.110.0040.00417.54
8.1.100.0070.00017.64
8.1.90.0000.00817.44
8.1.80.0030.00517.52
8.1.70.0030.00317.65
8.1.60.0060.00317.75
8.1.50.0040.00417.72
8.1.40.0040.00417.50
8.1.30.0040.00417.84
8.1.20.0000.00817.86
8.1.10.0030.00617.77
8.1.00.0040.00417.67
8.0.300.0040.00420.10
8.0.290.0000.00817.00
8.0.280.0000.00718.72
8.0.270.0030.00317.40
8.0.260.0000.00617.43
8.0.250.0040.00417.12
8.0.240.0000.00817.21
8.0.230.0030.00317.18
8.0.220.0020.00517.16
8.0.210.0000.00717.15
8.0.200.0030.00317.18
8.0.190.0030.00517.21
8.0.180.0030.00617.05
8.0.170.0080.00017.04
8.0.160.0070.00017.14
8.0.150.0040.00717.00
8.0.140.0040.00417.10
8.0.130.0060.00013.54
8.0.120.0030.00517.09
8.0.110.0000.00717.04
8.0.100.0030.00617.21
8.0.90.0070.00016.97
8.0.80.0110.00317.03
8.0.70.0050.00217.00
8.0.60.0080.00016.93
8.0.50.0040.00417.11
8.0.30.0090.00917.31
8.0.20.0130.00917.40
8.0.10.0040.00417.27
8.0.00.0140.00516.96
7.4.330.0020.00215.32
7.4.320.0030.00316.74
7.4.300.0030.00316.91
7.4.290.0000.00716.79
7.4.280.0060.00316.71
7.4.270.0000.00716.78
7.4.260.0070.00016.74
7.4.250.0000.00716.54
7.4.240.0040.00316.82
7.4.230.0050.00316.80
7.4.220.0090.00916.77
7.4.210.0080.01016.85
7.4.200.0050.00216.82
7.4.160.0060.00916.75
7.4.150.0060.01117.40
7.4.140.0170.01017.86
7.4.130.0070.01016.86
7.4.120.0080.01416.75
7.4.110.0130.00316.50
7.4.100.0000.02116.73
7.4.90.0120.00916.68
7.4.80.0000.02319.39
7.4.70.0040.01416.73
7.4.60.0100.00716.71
7.4.50.0000.00616.74
7.4.40.0040.01216.88
7.4.30.0090.01316.79
7.4.00.0060.00915.30
7.3.330.0060.00013.27
7.3.320.0000.00713.33
7.3.310.0000.00816.58
7.3.300.0000.00716.45
7.3.290.0000.00616.48
7.3.280.0090.00816.44
7.3.270.0090.00917.40
7.3.260.0120.00816.83
7.3.250.0070.01116.48
7.3.240.0140.00316.43
7.3.230.0090.00916.78
7.3.210.0040.01216.58
7.3.200.0140.00716.89
7.3.190.0090.00616.70
7.3.180.0120.00616.49
7.3.170.0100.00716.74
7.3.160.0080.00916.71
7.3.10.0100.00316.69
7.3.00.0090.00316.81
7.2.330.0090.01516.87
7.2.320.0090.01216.70
7.2.310.0150.00816.93
7.2.300.0160.00616.80
7.2.290.0120.00916.97
7.2.130.0050.00516.91
7.2.120.0030.01217.07
7.2.110.0060.00617.08
7.2.100.0160.00316.88
7.2.90.0030.01316.70
7.2.80.0030.00717.21
7.2.70.0070.00716.89
7.2.60.0060.00916.96
7.2.50.0000.00917.17
7.2.40.0000.01817.11
7.2.30.0160.00017.24
7.2.20.0040.00416.97
7.2.10.0070.00716.95
7.2.00.0070.00618.43
7.1.250.0060.00916.00
7.1.200.0100.00316.13
7.1.100.0080.00818.23
7.1.70.0110.00417.21
7.1.60.0040.01819.18
7.1.50.0070.01417.09
7.1.00.0030.07722.55
7.0.200.0040.00416.72
7.0.60.0100.06720.15
7.0.50.0130.07717.95
7.0.40.0070.08720.20
7.0.30.0500.04720.23
7.0.20.0270.07020.29
7.0.10.0070.06720.28
7.0.00.0000.04720.28
5.6.280.0070.06321.01
5.6.210.0070.04020.91
5.6.200.0070.08318.29
5.6.190.0070.08720.48
5.6.180.0170.06020.77
5.6.170.0330.07320.60
5.6.160.0030.04720.70
5.6.150.0070.05718.25
5.6.140.0030.04018.18
5.6.130.0030.04018.28
5.6.120.0130.08021.12
5.6.110.0170.07321.16
5.6.100.0100.04721.02
5.6.90.0070.08321.11
5.6.80.0030.06020.57
5.6.70.4600.03720.56
5.5.350.0000.07020.50
5.5.340.0170.07318.14
5.5.330.0070.04020.64
5.5.320.0130.04320.32
5.5.310.0270.06720.39
5.5.300.0100.04318.05
5.5.290.0000.08318.11
5.5.280.0070.08021.00
5.5.270.0100.08320.84
5.5.260.0070.08720.87
5.5.250.0100.06020.82
5.5.240.0130.07320.11
5.4.450.0130.06319.32
5.4.440.0230.04319.72
5.4.430.0100.05319.54
5.4.420.0800.05319.54
5.4.410.0800.05019.20
5.4.400.0870.05319.30
5.4.390.0830.06719.30
5.4.380.0730.05719.30
5.4.370.0730.05319.33
5.4.360.0930.07019.02
5.4.350.0800.05718.97
5.4.340.0900.06019.36
5.4.320.0870.05319.13
5.4.310.0770.05719.16
5.4.300.0830.05019.19
5.4.290.0900.06319.23
5.4.280.0730.06018.98
5.4.270.0830.05019.15
5.4.260.0830.05719.21
5.4.250.0870.04719.21
5.4.240.0830.05718.98
5.4.230.0830.05019.21
5.4.220.0800.06019.19
5.4.210.0900.05319.21
5.4.200.0830.05016.82
5.4.190.0870.05019.23
5.4.180.0870.05318.99
5.4.170.0870.05319.41
5.4.160.0870.05018.92
5.4.150.0830.05319.10
5.4.140.0830.04716.73
5.4.130.0800.04716.59
5.4.120.0830.04716.47
5.4.110.0630.05716.50
5.4.100.0930.06716.30
5.4.90.0670.05716.40
5.4.80.0730.06316.50
5.4.70.0200.04016.57
5.4.60.0630.06716.59
5.4.50.0500.05016.47
5.4.40.0770.04016.41
5.4.30.0830.05016.46
5.4.20.1130.06316.41
5.4.10.0800.05016.48
5.4.00.0800.04715.96
5.3.290.1100.05014.76
5.3.280.0830.05314.43
5.3.270.0800.06714.70
5.3.260.0930.06314.56
5.3.250.1000.05714.57
5.3.240.0870.04714.45
5.3.230.0630.06014.55
5.3.220.0770.05014.41
5.3.210.0800.04714.45
5.3.200.0830.05014.46
5.3.190.0730.04714.52
5.3.180.0770.05314.36
5.3.170.0730.05014.54
5.3.160.0870.05314.41
5.3.150.0900.04314.52
5.3.140.0800.04714.43
5.3.130.1100.05714.57
5.3.120.0770.05714.39
5.3.110.0770.05714.49
5.3.100.0770.05713.88
5.3.90.0800.05714.11
5.3.80.0770.05013.86
5.3.70.0800.05013.88
5.3.60.0900.05714.02
5.3.50.1100.05013.79
5.3.40.1170.04713.90
5.3.30.0770.05013.86
5.3.20.1130.04713.68
5.3.10.1030.06013.67
5.3.00.0800.05713.59
5.2.170.0670.04011.00
5.2.160.0700.04011.14
5.2.150.0730.04711.20
5.2.140.0730.05311.09
5.2.130.0730.03711.00
5.2.120.0630.03711.16
5.2.110.0730.05311.26
5.2.100.0700.03311.07
5.2.90.0600.03711.16
5.2.80.0470.05010.96
5.2.70.0700.03711.04
5.2.60.0630.04310.94
5.2.50.0670.04011.07
5.2.40.0570.03311.05
5.2.30.0500.04310.93
5.2.20.0530.04010.90
5.2.10.0570.03310.87
5.2.00.0530.04010.73
5.1.60.0530.03010.09
5.1.50.0470.0409.92
5.1.40.0500.0379.95
5.1.30.0470.04010.30
5.1.20.0570.03310.41
5.1.10.0470.0409.99
5.1.00.0570.0379.97
5.0.50.0270.0308.47
5.0.40.0200.0338.43
5.0.30.0270.0438.27
5.0.20.0270.0278.18
5.0.10.0230.0338.25
5.0.00.0230.0478.02
4.4.90.0230.0236.93
4.4.80.0370.0236.93
4.4.70.0230.0236.93
4.4.60.0400.0306.93
4.4.50.0270.0236.93
4.4.40.0270.0336.93
4.4.30.0270.0206.93
4.4.20.0170.0336.93
4.4.10.0270.0206.93
4.4.00.0200.0336.93
4.3.110.0130.0306.93
4.3.100.0400.0306.93
4.3.90.0200.0276.93
4.3.80.0270.0476.93
4.3.70.0270.0206.93
4.3.60.0330.0236.93
4.3.50.0300.0176.93
4.3.40.0200.0376.93
4.3.30.0230.0136.93
4.3.20.0130.0236.93
4.3.10.0170.0206.93
4.3.00.0070.0207.11

preferences:
45 ms | 401 KiB | 5 Q