3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = "<root> <parent> <child name='Child1' /> <child name='Child2' /> <subparent> <child name='Child3' /> </subparent> </parent> <child name='Child4' /> </root>"; $xml = simplexml_load_string( $xml); foreach( $xml->xpath( 'child[@name="child2"]') as $child) { echo $child->attributes()['name'] . "\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.0170.00318.93
8.3.50.0090.00921.20
8.3.40.0120.00318.84
8.3.30.0140.00019.23
8.3.20.0040.00420.54
8.3.10.0080.00023.90
8.3.00.0050.00319.51
8.2.180.0120.00318.66
8.2.170.0150.00622.96
8.2.160.0090.00620.77
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0070.00026.16
8.2.120.0000.00722.54
8.2.110.0030.00622.66
8.2.100.0040.00817.88
8.2.90.0050.00319.65
8.2.80.0060.00317.97
8.2.70.0090.00017.88
8.2.60.0060.00318.18
8.2.50.0080.00018.07
8.2.40.0050.00318.47
8.2.30.0000.00818.34
8.2.20.0050.00317.86
8.2.10.0000.00718.30
8.2.00.0040.00418.14
8.1.280.0080.00825.92
8.1.270.0060.00324.16
8.1.260.0000.00826.35
8.1.250.0080.00028.09
8.1.240.0030.00724.25
8.1.230.0060.00619.40
8.1.220.0040.00418.16
8.1.210.0000.00918.77
8.1.200.0110.00017.73
8.1.190.0060.00317.50
8.1.180.0040.00418.10
8.1.170.0080.00020.78
8.1.160.0090.00022.35
8.1.150.0000.00719.18
8.1.140.0000.00717.80
8.1.130.0030.00318.26
8.1.120.0000.00717.87
8.1.110.0000.00817.69
8.1.100.0000.00817.67
8.1.90.0000.00717.72
8.1.80.0000.00717.79
8.1.70.0050.00317.65
8.1.60.0100.00317.82
8.1.50.0000.00817.73
8.1.40.0040.00417.73
8.1.30.0050.00317.88
8.1.20.0020.00517.86
8.1.10.0000.00917.80
8.1.00.0040.00417.77
8.0.300.0000.00718.77
8.0.290.0040.00417.00
8.0.280.0030.00318.92
8.0.270.0030.00317.68
8.0.260.0000.00717.61
8.0.250.0000.00717.32
8.0.240.0000.00617.31
8.0.230.0000.00717.34
8.0.220.0040.00417.25
8.0.210.0030.00317.13
8.0.200.0030.00317.31
8.0.190.0000.00717.19
8.0.180.0050.00317.14
8.0.170.0050.00317.31
8.0.160.0040.00417.35
8.0.150.0000.00717.25
8.0.140.0050.00317.29
8.0.130.0060.00013.75
8.0.120.0000.00717.20
8.0.110.0050.00317.27
8.0.100.0050.00317.19
8.0.90.0040.00417.24
8.0.80.0100.00617.22
8.0.70.0040.00417.12
8.0.60.0040.00417.18
8.0.50.0080.00017.19
8.0.30.0090.00917.51
8.0.20.0110.01217.40
8.0.10.0040.00417.29
8.0.00.0060.01117.13
7.4.330.0050.00215.02
7.4.320.0030.00316.88
7.4.300.0070.00016.92
7.4.290.0040.00416.98
7.4.280.0090.00016.79
7.4.270.0030.00316.98
7.4.260.0050.00316.79
7.4.250.0050.00316.86
7.4.240.0040.00416.82
7.4.230.0040.00417.07
7.4.220.0040.01316.82
7.4.210.0100.01016.90
7.4.200.0040.00416.79
7.4.160.0000.01516.95
7.4.150.0120.01217.40
7.4.140.0060.01117.86
7.4.130.0120.01016.74
7.4.120.0080.00916.72
7.4.110.0110.00716.86
7.4.100.0100.00716.87
7.4.90.0060.01316.84
7.4.80.0100.00719.39
7.4.70.0100.01416.70
7.4.60.0100.00616.77
7.4.50.0030.00616.75
7.4.40.0060.01616.67
7.4.30.0060.01016.81
7.4.00.0100.00314.96
7.3.330.0030.00213.48
7.3.320.0000.00513.23
7.3.310.0050.00216.50
7.3.300.0070.00016.50
7.3.290.0090.00516.65
7.3.280.0100.00416.57
7.3.270.0120.00917.40
7.3.260.0130.00716.71
7.3.250.0120.00716.69
7.3.240.0090.00916.95
7.3.230.0060.01216.80
7.3.210.0080.01116.68
7.3.200.0000.01619.39
7.3.190.0060.01616.98
7.3.180.0100.01216.49
7.3.170.0070.01416.85
7.3.160.0060.01016.57
7.2.330.0070.01116.77
7.2.320.0110.00616.85
7.2.310.0150.00016.95
7.2.300.0100.00716.98
7.2.290.0090.01516.74
7.2.60.0000.01616.63
7.2.00.0040.01119.50
7.1.200.0090.00615.69
7.1.100.0040.00818.11
7.1.70.0070.00317.33
7.1.60.0090.01519.32
7.1.50.0080.01117.16
7.1.00.0070.07322.66
7.0.200.0030.00816.89
7.0.140.0070.07022.30
7.0.60.0070.08320.20
7.0.50.0200.05318.05
7.0.40.0070.06020.27
7.0.30.0530.06720.36
7.0.20.0070.05020.22
7.0.10.0030.04320.39
7.0.00.0070.04720.38
5.6.280.0070.07021.25
5.6.210.0000.09020.77
5.6.200.0130.06318.43
5.6.190.0070.05020.50
5.6.180.0370.07720.61
5.6.170.0400.06020.71
5.6.160.0070.08320.69
5.6.150.0070.08018.42
5.6.140.0070.07318.33
5.6.130.0100.07718.36
5.6.120.0100.07721.26
5.6.110.0070.07721.16
5.6.100.0130.08321.19
5.6.90.0130.07721.24
5.6.80.0100.07320.56
5.6.70.3830.04020.53
5.5.350.0170.06320.69
5.5.340.0070.08018.09
5.5.330.0170.04320.39
5.5.320.0230.04320.39
5.5.310.0100.04720.43
5.5.300.0100.07318.16
5.5.290.0100.05018.21
5.5.280.0130.08020.91
5.5.270.0000.08721.04
5.5.260.0170.07320.97
5.5.250.0100.05320.97
5.5.240.0300.07320.37
5.4.450.0770.06019.70
5.4.440.0470.05719.62
5.4.430.0030.06319.40
5.4.420.0630.06019.39
5.4.410.0670.05319.63
5.4.400.0770.05319.44
5.4.390.0830.06019.40
5.4.380.0130.05319.40
5.4.370.0800.05019.24
5.4.360.0830.06719.06
5.4.350.0870.06019.38
5.4.340.0050.03612.23
5.4.320.0080.03412.72
5.4.310.0080.03612.72
5.4.300.0050.03712.72
5.4.290.0070.03612.72
5.4.280.0070.03512.61
5.4.270.0100.04012.62
5.4.260.0070.04412.62
5.4.250.0050.04312.61
5.4.240.0120.04912.61
5.4.230.0060.05712.61
5.4.220.0120.03812.61
5.4.210.0100.03912.61
5.4.200.0060.05312.61
5.4.190.0080.03812.60
5.4.180.0090.04012.60
5.4.170.0060.03812.62
5.4.160.0040.03912.61
5.4.150.0100.03912.61
5.4.140.0100.04112.29
5.4.130.0050.03712.28
5.4.120.0070.03512.23
5.4.110.0060.03912.23
5.4.100.0080.03512.23
5.4.90.0080.05012.23
5.4.80.0110.04412.23
5.4.70.0050.03812.23
5.4.60.0070.03412.23
5.4.50.0010.04012.22
5.4.40.0040.03812.21
5.4.30.0070.03312.20
5.4.20.0050.04112.21
5.4.10.0090.04112.21
5.4.00.0130.03311.70
5.3.290.0060.04412.80
5.3.280.0080.03912.71
5.3.270.0050.04112.72
5.3.260.0060.03912.72
5.3.250.0070.03912.72
5.3.240.0080.03812.72
5.3.230.0080.03812.70
5.3.220.0060.03912.68
5.3.210.0100.03612.68
5.3.200.0090.04612.68
5.3.190.0090.03712.68
5.3.180.0110.05312.67
5.3.170.0050.04012.67
5.3.160.0050.03912.67
5.3.150.0100.03712.67
5.3.140.0030.04012.66
5.3.130.0060.03912.66
5.3.120.0060.03912.65
5.3.110.0050.04212.65
5.3.100.0050.03912.12
5.3.90.0110.03212.09
5.3.80.0070.03512.08
5.3.70.0060.03612.07
5.3.60.0040.03812.06
5.3.50.0060.03612.00
5.3.40.0080.03512.00
5.3.30.0070.03511.95
5.3.20.0040.03711.73
5.3.10.0060.03411.70
5.3.00.0050.03711.69
5.2.170.0050.0319.19
5.2.160.0040.0309.18
5.2.150.0030.0329.18
5.2.140.0040.0409.18
5.2.130.0080.0269.14
5.2.120.0050.0359.14
5.2.110.0080.0319.15
5.2.100.0070.0299.14
5.2.90.0040.0339.14
5.2.80.0030.0329.14
5.2.70.0060.0299.14
5.2.60.0050.0309.10
5.2.50.0030.0329.06
5.2.40.0050.0289.04
5.2.30.0030.0329.01
5.2.20.0070.0279.00
5.2.10.0080.0308.93
5.2.00.0060.0308.79
5.1.60.0020.0268.07
5.1.50.0040.0258.07
5.1.40.0020.0278.05
5.1.30.0010.0308.39
5.1.20.0040.0278.42
5.1.10.0010.0308.14
5.1.00.0040.0278.14
5.0.50.0030.0216.63
5.0.40.0040.0196.48
5.0.30.0040.0316.29
5.0.20.0030.0206.26
5.0.10.0050.0186.24
5.0.00.0030.0316.23
4.4.90.0020.0174.78
4.4.80.0020.0164.75
4.4.70.0030.0154.76
4.4.60.0040.0154.76
4.4.50.0050.0134.77
4.4.40.0040.0244.71
4.4.30.0020.0174.76
4.4.20.0050.0134.84
4.4.10.0050.0144.84
4.4.00.0040.0244.76
4.3.110.0030.0214.67
4.3.100.0030.0154.66
4.3.90.0020.0154.63
4.3.80.0030.0294.58
4.3.70.0020.0164.63
4.3.60.0010.0174.63
4.3.50.0020.0164.63
4.3.40.0020.0274.54
4.3.30.0020.0173.29
4.3.20.0020.0213.27
4.3.10.0020.0193.22
4.3.00.0130.0207.00

preferences:
43.93 ms | 400 KiB | 5 Q