3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = "<root> <parent> <child name='Child1' /> <child name='Child2' > <subparent name='subchild'> naiya </subparent> </child> </parent> <child name='Child4' /> </root>"; $xml = simplexml_load_string( $xml); echo $xml->xpath( '//child[@name="Child2"]'); foreach( $xml->xpath( '//child[@name="Child2"]/subparent') as $child) { echo $child . "\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.0110.00417.13
8.3.60.0070.01018.81
8.3.50.0180.00522.08
8.3.40.0140.00718.98
8.3.30.0040.01119.42
8.3.20.0050.00220.58
8.3.10.0080.00022.20
8.3.00.0080.00019.63
8.2.180.0120.00617.00
8.2.170.0040.01122.96
8.2.160.0080.00520.64
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00022.34
8.2.110.0040.00422.63
8.2.100.0040.00818.00
8.2.90.0000.00819.61
8.2.80.0090.00018.00
8.2.70.0060.00617.88
8.2.60.0040.00418.28
8.2.50.0000.00818.07
8.2.40.0050.00318.42
8.2.30.0030.00518.31
8.2.20.0000.00818.18
8.2.10.0050.00318.61
8.2.00.0000.00818.02
8.1.280.0070.00725.92
8.1.270.0080.00024.04
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0060.00324.08
8.1.230.0080.00319.54
8.1.220.0040.00418.02
8.1.210.0050.00318.77
8.1.200.0050.00517.48
8.1.190.0040.00417.48
8.1.180.0000.00818.10
8.1.170.0030.00619.03
8.1.160.0040.00422.41
8.1.150.0000.00819.24
8.1.140.0030.00617.68
8.1.130.0000.00818.18
8.1.120.0040.00417.86
8.1.110.0030.00517.87
8.1.100.0080.00017.73
8.1.90.0000.00717.86
8.1.80.0030.00417.88
8.1.70.0000.00717.82
8.1.60.0030.00617.84
8.1.50.0000.00817.73
8.1.40.0060.00317.73
8.1.30.0040.00417.84
8.1.20.0080.00018.03
8.1.10.0050.00217.85
8.1.00.0000.00817.83
8.0.300.0000.00718.77
8.0.290.0000.00817.13
8.0.280.0000.00718.66
8.0.270.0030.00317.55
8.0.260.0040.00417.54
8.0.250.0070.00017.46
8.0.240.0030.00517.39
8.0.230.0050.00317.21
8.0.220.0030.00317.31
8.0.210.0070.00017.36
8.0.200.0040.00417.37
8.0.190.0080.00017.22
8.0.180.0070.00017.21
8.0.170.0000.00717.38
8.0.160.0070.00017.31
8.0.150.0000.00717.36
8.0.140.0050.00217.11
8.0.130.0050.00013.78
8.0.120.0000.00817.27
8.0.110.0000.00717.14
8.0.100.0000.00717.09
8.0.90.0040.00417.19
8.0.80.0090.00617.31
8.0.70.0040.00417.29
8.0.60.0070.00017.22
8.0.50.0040.00417.25
8.0.30.0130.00617.37
8.0.20.0070.01217.42
8.0.10.0000.00717.34
8.0.00.0090.00917.05
7.4.330.0040.00415.02
7.4.320.0000.00616.89
7.4.300.0000.00616.83
7.4.290.0070.00016.79
7.4.280.0040.00416.98
7.4.270.0030.00316.71
7.4.260.0040.00416.82
7.4.250.0000.00716.91
7.4.240.0040.00416.93
7.4.230.0070.00017.07
7.4.220.0110.00717.05
7.4.210.0060.00916.97
7.4.200.0030.00316.93
7.4.160.0100.00716.80
7.4.150.0100.01317.40
7.4.140.0110.01117.86
7.4.130.0080.01116.94
7.4.120.0100.01116.87
7.4.110.0030.01717.00
7.4.100.0070.01716.80
7.4.90.0110.00716.83
7.4.80.0150.00019.39
7.4.70.0080.01716.85
7.4.60.0070.01016.86
7.4.50.0030.00616.79
7.4.40.0070.01016.82
7.4.30.0130.00416.88
7.4.00.0120.00314.70
7.3.330.0060.00013.47
7.3.320.0030.00313.49
7.3.310.0030.00316.77
7.3.300.0000.00616.76
7.3.290.0150.00316.67
7.3.280.0060.01116.70
7.3.270.0170.00617.40
7.3.260.0080.00816.86
7.3.250.0050.01116.76
7.3.240.0070.01016.76
7.3.230.0100.00716.51
7.3.210.0100.00716.72
7.3.200.0140.00319.39
7.3.190.0060.01116.75
7.3.180.0120.00316.58
7.3.170.0060.01316.84
7.3.160.0130.00916.81
7.2.330.0030.01417.00
7.2.320.0110.01116.89
7.2.310.0100.01516.93
7.2.300.0060.01017.01
7.2.290.0060.01216.96
7.2.80.0090.00616.96
7.2.00.0000.01219.21
7.1.200.0050.00515.93
7.1.100.0030.00918.32
7.1.70.0030.00517.01
7.1.60.0060.01619.32
7.1.50.0220.01334.95
7.1.00.0030.07722.55
7.0.200.0100.00316.66
7.0.140.0070.07022.27
7.0.60.0130.07720.04
7.0.50.0100.07018.00
7.0.40.0070.06320.55
7.0.30.0430.05020.37
7.0.20.0330.04720.38
7.0.10.0030.09020.22
7.0.00.0030.04720.16
5.6.280.0000.07721.20
5.6.210.0100.07720.67
5.6.200.0100.04318.34
5.6.190.0170.06720.64
5.6.180.0230.08020.54
5.6.170.0400.03720.77
5.6.160.0130.08020.75
5.6.150.0000.08718.39
5.6.140.0030.04018.36
5.6.130.0030.07318.36
5.6.120.0130.03021.07
5.6.110.0070.08721.15
5.6.100.0070.04021.16
5.6.90.0030.07721.13
5.6.80.0170.07020.63
5.6.70.4770.04020.58
5.5.350.0300.07720.61
5.5.340.0070.03718.16
5.5.330.0170.05320.68
5.5.320.0270.08320.34
5.5.310.0170.06320.70
5.5.300.0030.05718.09
5.5.290.0030.05318.17
5.5.280.0030.05720.95
5.5.270.0070.08021.14
5.5.260.0100.03320.91
5.5.250.0130.06320.72
5.5.240.0230.07720.30
5.4.450.0800.06019.39
5.4.440.0130.05319.41
5.4.430.0830.05019.61
5.4.420.0830.06319.43
5.4.410.0570.06319.27
5.4.400.0670.05319.10
5.4.390.0770.05719.48
5.4.380.0930.05319.43
5.4.370.0900.04719.25
5.4.360.0800.07019.43
5.4.350.0630.05719.46
5.4.340.0060.03712.23
5.4.320.0090.03712.71
5.4.310.0070.04312.71
5.4.300.0080.04012.72
5.4.290.0060.04012.71
5.4.280.0100.03212.62
5.4.270.0090.03312.61
5.4.260.0050.03912.62
5.4.250.0050.03912.61
5.4.240.0040.03912.62
5.4.230.0080.03612.61
5.4.220.0080.03412.61
5.4.210.0040.03712.61
5.4.200.0090.03612.61
5.4.190.0040.04012.61
5.4.180.0090.03712.60
5.4.170.0040.03712.61
5.4.160.0070.03612.61
5.4.150.0070.03712.61
5.4.140.0050.04212.29
5.4.130.0070.04712.28
5.4.120.0060.04312.24
5.4.110.0060.05412.23
5.4.100.0080.03912.23
5.4.90.0040.04812.23
5.4.80.0090.04512.23
5.4.70.0090.03312.23
5.4.60.0010.04012.23
5.4.50.0050.03712.22
5.4.40.0060.03512.21
5.4.30.0070.03412.21
5.4.20.0080.04012.21
5.4.10.0070.04012.21
5.4.00.0150.05211.70
5.3.290.0160.04112.98
5.3.280.0100.04712.91
5.3.270.0070.04212.93
5.3.260.0040.04212.93
5.3.250.0080.03612.92
5.3.240.0060.03812.93
5.3.230.0070.03812.91
5.3.220.0090.03512.88
5.3.210.0110.04512.89
5.3.200.0120.06512.88
5.3.190.0110.04812.88
5.3.180.0050.03912.88
5.3.170.0040.04012.88
5.3.160.0040.04012.88
5.3.150.0110.04012.88
5.3.140.0040.04612.87
5.3.130.0080.04112.87
5.3.120.0080.04912.87
5.3.110.0060.04812.87
5.3.100.0080.04412.35
5.3.90.0110.04512.34
5.3.80.0110.04012.32
5.3.70.0110.07712.32
5.3.60.0140.07312.30
5.3.50.0220.08012.25
5.3.40.0090.04912.25
5.3.30.0090.04612.21
5.3.20.0080.04312.00
5.3.10.0210.09011.96
5.3.00.0070.03611.95
5.2.170.0080.0359.45
5.2.160.0080.0279.45
5.2.150.0010.0359.45
5.2.140.0070.0309.45
5.2.130.0070.0419.41
5.2.120.0050.0299.41
5.2.110.0080.0739.42
5.2.100.0060.0409.41
5.2.90.0080.0419.41
5.2.80.0070.0339.40
5.2.70.0100.0309.40
5.2.60.0070.0309.35
5.2.50.0050.0319.32
5.2.40.0080.0279.30
5.2.30.0060.0299.27
5.2.20.0060.0429.27
5.2.10.0120.0539.19
5.2.00.0030.0359.05
5.1.60.0040.0268.33
5.1.50.0040.0268.33
5.1.40.0030.0298.31
5.1.30.0040.0348.66
5.1.20.0050.0338.68
5.1.10.0020.0318.40
5.1.00.0040.0288.41
5.0.50.0020.0256.87
5.0.40.0030.0206.73
5.0.30.0030.0326.55
5.0.20.0050.0216.52
5.0.10.0050.0286.50
5.0.00.0070.0376.49
4.4.90.0030.0224.78
4.4.80.0030.0164.75
4.4.70.0020.0174.75
4.4.60.0020.0174.75
4.4.50.0020.0174.77
4.4.40.0030.0254.71
4.4.30.0040.0144.76
4.4.20.0030.0154.84
4.4.10.0030.0154.85
4.4.00.0030.0254.75
4.3.110.0020.0174.67
4.3.100.0040.0144.66
4.3.90.0030.0144.63
4.3.80.0030.0254.58
4.3.70.0020.0164.63
4.3.60.0040.0134.62
4.3.50.0040.0194.63
4.3.40.0040.0514.54
4.3.30.0060.0223.28
4.3.20.0020.0213.25
4.3.10.0000.0243.22
4.3.00.0130.0207.00

preferences:
45.45 ms | 401 KiB | 5 Q