3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = ' <div> <p>Lorem Ipsum1</p> <p>Lorem Ipsum2</p> <h2>Title</h2> <p>Lorem Ipsum3</p><!-- PHP gets this paragraph --> <p>Lorem Ipsum4</p> <h2>Title</h2> <p>Lorem Ipsum5</p> </div>'; $xml = simplexml_load_string($str); $headings = $xml->xpath('h2'); $contents = []; foreach ($headings as $heading) { $contents[] = (string)$heading->xpath('following-sibling::p')[0]; } var_dump($contents);

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.5.10.0110.00816.88
8.5.00.0110.00820.34
8.4.160.0090.01424.32
8.4.150.0020.00014.05
8.4.140.0110.01118.14
8.4.130.0060.00419.04
8.4.120.0120.00921.02
8.4.110.0130.00719.24
8.4.100.0060.00418.16
8.4.90.0110.00820.91
8.4.80.0130.00619.40
8.4.70.0050.00419.26
8.4.60.0110.01022.66
8.4.50.0130.00418.97
8.4.40.0160.00320.00
8.4.30.0100.01022.53
8.4.20.0120.00418.73
8.4.10.0030.00619.71
8.3.280.0100.01018.82
8.3.270.0120.00817.00
8.3.260.0100.01117.18
8.3.250.0110.00819.27
8.3.240.0100.01018.61
8.3.230.0120.00716.82
8.3.220.0120.00619.33
8.3.210.0120.00816.99
8.3.200.0060.00516.97
8.3.190.0110.00819.19
8.3.180.0100.00819.18
8.3.170.0120.00617.06
8.3.160.0120.00617.62
8.3.150.0140.00517.77
8.3.140.0070.01316.98
8.3.130.0040.00418.88
8.3.120.0030.00621.16
8.3.110.0050.00520.94
8.3.100.0040.00424.06
8.3.90.0130.00626.77
8.3.80.0100.00018.80
8.3.70.0060.00917.00
8.3.60.0070.01118.75
8.3.50.0090.00718.61
8.3.40.0070.01419.09
8.3.30.0040.01119.04
8.3.20.0040.00421.27
8.3.10.0040.00420.90
8.3.00.0030.00621.18
8.2.290.0050.00516.71
8.2.280.0090.01120.64
8.2.270.0070.01116.85
8.2.260.0140.00417.21
8.2.250.0070.00717.84
8.2.240.0080.00017.83
8.2.230.0030.00622.58
8.2.220.0070.00337.54
8.2.210.0000.01426.77
8.2.200.0130.00616.88
8.2.190.0060.01216.88
8.2.180.0120.00316.88
8.2.170.0140.00019.37
8.2.160.0110.00422.96
8.2.150.0000.00724.18
8.2.140.0080.00024.66
8.2.130.0060.00326.16
8.2.120.0080.00021.37
8.2.110.0050.00522.70
8.2.100.0120.00018.16
8.2.90.0000.00818.59
8.2.80.0040.00418.13
8.2.70.0030.00518.41
8.2.60.0030.00618.13
8.2.50.0090.00018.00
8.2.40.0000.00719.61
8.2.30.0000.00819.67
8.2.20.0000.00718.50
8.2.10.0040.00419.92
8.2.00.0000.00818.47
8.1.330.0090.01116.87
8.1.320.0100.01018.49
8.1.310.0060.00316.54
8.1.300.0040.01519.04
8.1.290.0030.00730.84
8.1.280.0120.00625.92
8.1.270.0050.00320.86
8.1.260.0080.00026.35
8.1.250.0060.01228.09
8.1.240.0090.00021.22
8.1.230.0060.00618.14
8.1.220.0040.00418.16
8.1.210.0050.00319.27
8.1.200.0000.00817.63
8.1.190.0030.00519.26
8.1.180.0050.00318.10
8.1.170.0040.00418.88
8.1.160.0040.00419.20
8.1.150.0040.00419.21
8.1.140.0000.00720.64
8.1.130.0030.00320.59
8.1.120.0000.00717.76
8.1.110.0030.00517.71
8.1.100.0040.00417.71
8.1.90.0000.00817.68
8.1.80.0000.00917.70
8.1.70.0000.00717.79
8.1.60.0000.00817.95
8.1.50.0000.00917.96
8.1.40.0040.00417.95
8.1.30.0030.00817.95
8.1.20.0000.00918.10
8.1.10.0050.00317.96
8.1.00.0090.00017.84
8.0.300.0030.00520.39
8.0.290.0050.00317.25
8.0.280.0030.00318.79
8.0.270.0000.00717.14
8.0.260.0000.00618.86
8.0.250.0040.00417.29
8.0.240.0000.00817.35
8.0.230.0000.00717.38
8.0.220.0000.00717.32
8.0.210.0040.00417.32
8.0.200.0050.00317.35
8.0.190.0040.00417.25
8.0.180.0040.00417.30
8.0.170.0060.00317.18
8.0.160.0030.00717.25
8.0.150.0040.00417.25
8.0.140.0040.00417.25
8.0.130.0090.00415.42
8.0.120.0110.00317.18
8.0.110.0050.00917.27
8.0.100.0060.00817.23
8.0.90.0080.00517.17
8.0.80.0050.01217.29
8.0.70.0070.00617.24
8.0.60.0090.00517.13
8.0.50.0100.00417.18
8.0.30.0110.00917.34
8.0.20.0120.00717.44
8.0.10.0090.00417.33
8.0.00.0120.00817.22
7.4.330.0020.00215.55
7.4.320.0000.00616.99
7.4.300.0060.00016.78
7.4.290.0030.00316.98
7.4.280.0040.00416.99
7.4.270.0000.00716.98
7.4.260.0080.00616.97
7.4.250.0080.00616.93
7.4.240.0060.00416.94
7.4.230.0070.00417.04
7.4.220.0090.00517.06
7.4.210.0110.00516.97
7.4.200.0090.00516.87
7.4.190.0180.00316.90
7.4.180.0120.00716.86
7.4.160.0100.00716.92
7.4.150.0150.00317.00
7.4.140.0100.00817.33
7.4.130.0070.00916.91
7.4.120.0090.00816.93
7.4.110.0060.00916.88
7.4.100.0060.00816.91
7.4.90.0110.00316.82
7.4.80.0100.00618.12
7.4.70.0100.00416.79
7.4.60.0090.00516.85
7.4.50.0090.00316.83
7.4.40.0110.00416.77
7.4.30.0120.00016.80
7.4.20.0060.00616.86
7.4.10.0090.00316.81
7.4.00.0080.00515.90
7.3.330.0100.00215.21
7.3.320.0070.00615.12
7.3.310.0100.00316.51
7.3.300.0080.00616.78
7.3.290.0090.00516.73
7.3.280.0120.00716.65
7.3.270.0170.00316.78
7.3.260.0130.00716.80
7.3.250.0150.00816.74
7.3.240.0080.01016.86
7.3.230.0160.00416.70
7.3.220.0140.00716.60
7.3.210.0100.00616.81
7.3.200.0140.00016.56
7.3.190.0080.00916.67
7.3.180.0070.00916.79
7.3.170.0120.00416.65
7.3.160.0060.01016.65
7.3.150.0100.00316.54
7.3.140.0090.00516.39
7.3.130.0070.00716.61
7.3.120.0120.00716.58
7.3.110.0110.00816.53
7.3.100.0110.00716.69
7.3.90.0180.00016.73
7.3.80.0150.01016.54
7.3.70.0230.00516.73
7.3.60.0170.00616.61
7.3.50.0130.00816.80
7.3.40.0150.00416.61
7.3.30.0150.00316.62
7.3.20.0360.00516.87
7.3.10.0230.00616.82
7.3.00.0140.00916.95
7.2.340.0150.00316.59
7.2.330.0130.00716.81
7.2.320.0120.00616.87
7.2.310.0150.00516.89
7.2.300.0090.00916.89
7.2.290.0110.00816.85
7.2.280.0190.00016.89
7.2.270.0150.00516.84
7.2.260.0150.00316.86
7.2.250.0200.00016.57
7.2.240.0150.00516.86
7.2.230.0170.00316.75
7.2.220.0170.00316.77
7.2.210.0190.00016.84
7.2.200.0180.00416.96
7.2.190.0150.00416.98
7.2.180.0120.00616.96
7.2.170.0110.00716.94
7.2.160.0150.00417.08
7.2.150.0210.00217.03
7.2.140.0110.00617.15
7.2.130.0300.00517.20
7.2.120.0180.00517.19
7.2.110.0120.00716.90
7.2.100.0190.00316.93
7.2.90.0250.00617.09
7.2.80.0140.00817.06
7.2.70.0280.00417.05
7.2.60.0330.00617.02
7.2.50.0230.00717.12
7.2.40.0400.00017.17
7.2.30.0950.00117.09
7.2.20.1030.00517.15
7.2.10.0660.00316.94
7.2.00.0570.00317.17
7.1.330.0150.00317.89
7.1.320.0090.00917.59
7.1.310.0130.00417.89
7.1.300.0090.00917.89
7.1.290.0140.00517.86
7.1.280.0140.00417.80
7.1.270.0150.00617.67
7.1.260.0200.00317.63
7.1.250.0160.00715.89
7.1.240.0180.00317.75
7.1.230.0170.00417.80
7.1.220.0180.00317.78
7.1.210.0150.00617.76
7.1.200.0180.00317.50
7.1.190.0200.00017.78
7.1.180.0180.00517.73
7.1.170.0100.01317.70
7.1.160.0140.00717.61
7.1.150.0110.01017.52
7.1.140.0090.01117.75
7.1.130.0190.00417.72
7.1.120.0190.00517.73
7.1.110.0140.00817.79
7.1.100.0190.00317.61
7.1.90.0180.00317.57
7.1.80.0170.00417.54
7.1.70.0110.01117.29
7.1.60.0180.00517.66
7.1.50.0120.01017.81
7.1.40.0170.00617.74
7.1.30.0200.00317.68
7.1.20.0190.00417.45
7.1.10.0160.00417.76
7.1.00.0170.00717.73

preferences:
28.85 ms | 403 KiB | 5 Q