3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = "<root> <itemList> <item> <name>A</name> <type>AAA</type> </item> <item> <name>B</name> <type>BBB</type> </item> <item> <name>C</name> <type>CCC</type> </item> <item> <name>C</name> <type>DDD</type> </item> </itemList> </root>"; $xml = new SimpleXMLElement($xml); $res = $xml->xpath('//type[contains(text(), "DDD")]/parent::item/preceding-sibling::item'); $total = count($res); echo "{$res[$total - 1]->name} ({$res[$total - 1]->type})".PHP_EOL;

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.130.0080.00018.58
8.3.120.0060.00320.92
8.3.110.0060.00320.94
8.3.100.0030.00524.06
8.3.90.0080.00026.77
8.3.80.0060.00318.55
8.3.70.0110.00416.88
8.3.60.0110.00418.43
8.3.50.0060.00818.64
8.3.40.0170.00318.95
8.3.30.0140.00018.88
8.3.20.0100.00323.93
8.3.10.0090.00424.65
8.3.00.0030.01024.78
8.2.250.0080.00018.53
8.2.240.0090.00017.76
8.2.230.0080.00022.58
8.2.220.0030.00637.54
8.2.210.0080.00826.77
8.2.200.0050.00517.25
8.2.190.0070.01118.51
8.2.180.0120.00925.92
8.2.170.0070.01419.14
8.2.160.0100.00322.96
8.2.150.0050.00824.92
8.2.140.0090.00525.16
8.2.130.0090.00425.91
8.2.120.0080.00523.52
8.2.110.0120.00123.31
8.2.100.0070.00721.97
8.2.90.0090.00422.07
8.2.80.0050.00622.52
8.2.70.0050.00821.98
8.2.60.0060.00321.83
8.2.50.0030.00622.04
8.2.40.0050.00323.22
8.2.30.0040.00422.82
8.2.20.0060.00222.06
8.2.10.0060.00322.04
8.2.00.0080.00022.01
8.1.300.0060.00318.10
8.1.290.0060.00330.84
8.1.280.0070.00725.92
8.1.270.0040.00424.91
8.1.260.0060.00927.05
8.1.250.0060.00626.88
8.1.240.0050.00424.05
8.1.230.0090.00223.37
8.1.220.0050.00321.78
8.1.210.0020.00622.42
8.1.200.0020.00621.70
8.1.190.0050.00821.58
8.1.180.0080.00621.88
8.1.170.0050.00322.36
8.1.160.0050.00322.43
8.1.150.0020.00623.17
8.1.140.0010.00721.89
8.1.130.0040.00322.57
8.1.120.0050.00721.77
8.1.110.0060.00521.67
8.1.100.0060.00721.76
8.1.90.0060.00621.66
8.1.80.0030.00621.79
8.1.70.0000.00921.78
8.1.60.0040.00621.81
8.1.50.0060.00321.71
8.1.40.0070.00121.68
8.1.30.0030.00721.80
8.1.20.0020.00821.87
8.1.10.0040.00421.73
8.1.00.0050.00421.75
8.0.300.0070.00223.12
8.0.290.0100.00121.39
8.0.280.0100.00222.17
8.0.270.0040.00421.36
8.0.260.0060.00423.00
8.0.250.0070.00121.46
8.0.240.0050.00521.43
8.0.230.0080.00121.49
8.0.220.0030.00621.47
8.0.210.0100.00121.48
8.0.200.0030.00521.51
8.0.190.0080.00521.47
8.0.180.0050.00321.47
8.0.170.0060.00621.41
8.0.160.0050.00321.41
8.0.150.0070.00421.46
8.0.140.0060.00521.42
8.0.130.0050.00419.66
8.0.120.0080.00321.47
8.0.110.0030.00521.37
8.0.100.0050.00521.40
8.0.90.0060.00521.41
8.0.80.0060.00621.44
8.0.70.0030.00521.41
8.0.60.0090.00221.40
8.0.50.0080.00321.53
8.0.30.0100.00819.05
8.0.20.0070.00820.24
8.0.10.0070.00421.50
8.0.00.0130.00719.26
7.4.330.0050.00020.61
7.4.320.0040.00821.29
7.4.300.0110.00021.32
7.4.290.0080.00421.22
7.4.280.0050.00721.29
7.4.270.0120.00221.28
7.4.260.0070.00621.21
7.4.250.0050.00721.24
7.4.240.0070.00621.24
7.4.230.0060.00521.29
7.4.220.0080.00421.29
7.4.210.0120.00521.30
7.4.200.0020.00921.24
7.4.190.0120.00425.66
7.4.180.0120.00525.66
7.4.160.0090.00819.01
7.4.150.0280.00425.66
7.4.140.0130.00819.16
7.4.130.0230.00719.84
7.4.120.0110.00918.20
7.4.110.0170.00419.78
7.4.100.0150.00619.88
7.4.90.0130.00919.80
7.4.80.0140.01020.63
7.4.70.0170.00619.76
7.4.60.0140.00719.80
7.4.50.0180.00919.73
7.4.40.0220.00619.71
7.4.30.0220.01221.19
7.4.20.0240.00921.30
7.4.10.0230.01221.22
7.4.00.0150.00919.29
7.3.330.0140.00619.57
7.3.320.0160.00419.52
7.3.310.0170.00321.20
7.3.300.0110.00821.15
7.3.290.0140.00918.87
7.3.280.0120.00718.86
7.3.270.0370.00925.66
7.3.260.0130.00919.07
7.3.250.0160.00518.49
7.3.240.0140.00618.55
7.3.230.0170.00519.68
7.3.220.0190.00521.16
7.3.210.0140.00819.75
7.3.200.0140.00719.79
7.3.190.0130.01019.72
7.3.180.0190.00619.64
7.3.170.0180.00619.69
7.3.160.0160.00819.83
7.3.150.0180.00921.20
7.3.140.0160.00821.13
7.3.130.0160.01221.21
7.3.120.0200.00321.17
7.3.110.0170.00821.28
7.3.100.0140.00921.22
7.3.90.0170.00921.10
7.3.80.0190.00421.09
7.3.70.0180.00521.24
7.3.60.0140.00921.21
7.3.50.0210.00321.12
7.3.40.0210.00221.09
7.3.30.0150.00721.21
7.3.20.0190.00521.21
7.3.10.0140.00819.06
7.3.00.0090.00919.10
7.2.340.0190.00621.30
7.2.330.0150.00619.86
7.2.320.0150.00619.83
7.2.310.0220.00519.89
7.2.300.0140.01119.87
7.2.290.0130.00919.83
7.2.280.0160.00921.16
7.2.270.0190.00621.40
7.2.260.0220.01121.24
7.2.250.0200.00421.39
7.2.240.0180.00821.33
7.2.230.0200.01321.32
7.2.220.0240.01121.30
7.2.210.0230.00921.26
7.2.200.0220.00321.29
7.2.190.0160.00821.38
7.2.180.0220.00221.23
7.2.170.0160.00921.38
7.2.160.0170.00621.23
7.2.150.0230.00421.39
7.2.140.0190.00521.29
7.2.130.0120.00919.20
7.2.120.0140.00619.19
7.2.110.0100.01019.20
7.2.100.0120.00819.20
7.2.90.0160.01019.27
7.2.80.0180.00519.26
7.2.70.0130.00819.73
7.2.60.0120.00519.26
7.2.50.0110.00819.66
7.2.40.0160.00819.74
7.2.30.0140.00619.32
7.2.20.0160.00819.36
7.2.10.0160.00819.42
7.2.00.0130.00819.37
7.1.330.0180.01220.81
7.1.320.0190.00320.79
7.1.310.0300.01220.81
7.1.300.0190.01120.71
7.1.290.0280.00220.77
7.1.280.0430.00720.79
7.1.270.0160.01320.77
7.1.260.0220.00820.72
7.1.250.0180.00618.37
7.1.240.0220.00120.70
7.1.230.0180.00820.75
7.1.220.0190.00620.74
7.1.210.0210.00420.73
7.1.200.0140.00519.22
7.1.190.0150.00721.65
7.1.180.0160.00521.63
7.1.170.0160.00721.68
7.1.160.0180.00421.60
7.1.150.0190.00819.99
7.1.140.0120.01120.09
7.1.130.0150.01220.02
7.1.120.0130.01020.10
7.1.110.0190.00919.90
7.1.100.0170.00619.87
7.1.90.0120.01119.85
7.1.80.0130.01119.76
7.1.70.0150.00919.60
7.1.60.0260.00725.63
7.1.50.0220.00925.51
7.1.40.0230.01125.49
7.1.30.0290.00925.45
7.1.20.0270.00925.38
7.1.10.0230.00819.44
7.1.00.0160.00819.48
7.0.330.0140.00820.55
7.0.320.0140.00820.59
7.0.310.0340.00721.55
7.0.300.0170.00521.48
7.0.290.0130.00921.51
7.0.280.0180.00721.49
7.0.270.0220.00021.49
7.0.260.0180.00621.48
7.0.250.0150.00821.53
7.0.240.0200.00721.46
7.0.230.0150.00721.57
7.0.220.0120.01021.44
7.0.210.0190.00821.59
7.0.200.0190.00421.53
7.0.190.0210.00621.54
7.0.180.0210.00221.57
7.0.170.0150.00621.57
7.0.160.0160.00521.54
7.0.150.0160.00921.48
7.0.140.0170.00421.54
7.0.130.0140.00721.61
7.0.120.0180.00321.47
7.0.110.0120.00821.51
7.0.100.0170.00221.53
7.0.90.0150.00321.44
7.0.80.0150.00621.54
7.0.70.0110.00621.52
7.0.60.0130.00321.50
7.0.50.0110.00521.49
7.0.40.0060.01021.51
7.0.30.0130.00721.44
7.0.20.0150.01021.44
7.0.10.0110.00921.50
7.0.00.0150.00321.49
5.6.400.0200.02021.01
5.6.390.0130.02821.09
5.6.380.0130.02121.03
5.6.370.0170.01821.07
5.6.360.0160.03321.01
5.6.350.0240.03021.03
5.6.340.0150.02421.02
5.6.330.0120.02421.04
5.6.320.0170.01921.00
5.6.310.0160.02221.05
5.6.300.0140.02120.81
5.6.290.0170.02921.06
5.6.280.0190.02820.96
5.6.270.0210.01721.01
5.6.260.0140.02620.94
5.6.250.0220.02320.99
5.6.240.0130.03621.05
5.6.230.0170.03820.85
5.6.220.0160.01821.03
5.6.210.0150.02521.00
5.6.200.0160.02020.93
5.6.190.0170.02120.99
5.6.180.0170.01920.87
5.6.170.0140.04121.04
5.6.160.0150.02020.94
5.6.150.0110.02620.99
5.6.140.0170.01720.92
5.6.130.0210.02021.01
5.6.120.0250.02820.90
5.6.110.0130.02820.99
5.6.100.0130.02420.91
5.6.90.0190.01920.96
5.6.80.0240.01020.93
5.6.70.0170.01920.98
5.6.60.0120.03720.89
5.6.50.0220.02820.90
5.6.40.0190.02020.92
5.6.30.0170.02421.09
5.6.20.0260.02520.98
5.6.10.0140.02020.94
5.6.00.0120.02120.95

preferences:
29.92 ms | 403 KiB | 5 Q