3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = null; $c = 1; $r = preg_replace_callback('/(<p( [^>]+)?>)/i', function ($res) { global $c; return '<p'.$res[2].' id="'.intval($c++).'">'; }, $text); $r = preg_replace('/(<p.*?)id="'.($c-1).'"(>)/i', '\1id="Last"\2', $r); $text = $r; echo $text;

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.0090.00618.67
8.3.50.0090.00722.11
8.3.40.0040.01118.96
8.3.30.0070.00719.08
8.3.20.0000.00920.21
8.3.10.0040.00422.05
8.3.00.0090.00022.37
8.2.180.0070.00716.88
8.2.170.0070.00722.96
8.2.160.0070.00721.02
8.2.150.0090.00024.18
8.2.140.0030.00624.66
8.2.130.0040.00426.16
8.2.120.0030.00619.52
8.2.110.0040.00422.11
8.2.100.0040.00819.57
8.2.90.0030.00519.17
8.2.80.0090.00018.04
8.2.70.0000.00817.75
8.2.60.0000.00818.05
8.2.50.0040.00418.07
8.2.40.0080.00018.23
8.2.30.0040.00418.12
8.2.20.0050.00317.98
8.2.10.0000.00919.62
8.2.00.0040.00417.95
8.1.280.0000.01425.92
8.1.270.0040.00422.00
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0050.00523.84
8.1.230.0000.01219.00
8.1.220.0080.00017.79
8.1.210.0000.00918.77
8.1.200.0070.00317.48
8.1.190.0080.00017.53
8.1.180.0060.00318.10
8.1.170.0040.00418.59
8.1.160.0000.00722.05
8.1.150.0050.00318.80
8.1.140.0100.00017.65
8.1.130.0030.00317.78
8.1.120.0040.00417.62
8.1.110.0000.00717.51
8.1.100.0000.00817.64
8.1.90.0040.00417.55
8.1.80.0000.00817.55
8.1.70.0040.00417.49
8.1.60.0000.00817.63
8.1.50.0040.00417.68
8.1.40.0040.00417.66
8.1.30.0040.00417.64
8.1.20.0000.00817.71
8.1.10.0040.00417.70
8.1.00.0040.00417.57
8.0.300.0000.00718.77
8.0.290.0000.00717.18
8.0.280.0000.00818.46
8.0.270.0030.00317.20
8.0.260.0030.00316.88
8.0.250.0030.00317.10
8.0.240.0030.00317.08
8.0.230.0000.00717.02
8.0.220.0070.00017.04
8.0.210.0070.00016.93
8.0.200.0030.00317.07
8.0.190.0000.00817.10
8.0.180.0030.00516.96
8.0.170.0000.00716.96
8.0.160.0040.00416.97
8.0.150.0000.00717.08
8.0.140.0000.00817.00
8.0.130.0030.00313.43
8.0.120.0040.00416.89
8.0.110.0000.00716.93
8.0.100.0040.00416.99
8.0.90.0040.00416.92
8.0.80.0030.01117.02
8.0.70.0000.00817.07
8.0.60.0040.00417.11
8.0.50.0040.00417.04
8.0.30.0100.01017.31
8.0.20.0110.00717.40
8.0.10.0040.00417.27
8.0.00.0050.01216.92
7.4.330.0040.00415.00
7.4.320.0000.00716.86
7.4.300.0050.00316.75
7.4.290.0000.01016.78
7.4.280.0030.00316.72
7.4.270.0090.00016.71
7.4.260.0000.00916.70
7.4.250.0090.00016.80
7.4.240.0050.00216.79
7.4.230.0030.00316.58
7.4.220.0090.01216.75
7.4.210.0080.00616.85
7.4.200.0000.00716.80
7.4.190.0070.00016.63
7.4.160.0130.00616.65
7.4.150.0160.01017.40
7.4.140.0110.00917.86
7.4.130.0160.00616.73
7.4.120.0030.01416.76
7.4.110.0060.01216.74
7.4.100.0090.00916.61
7.4.90.0110.00616.70
7.4.80.0090.01019.39
7.4.70.0060.01016.76
7.4.60.0070.01016.61
7.4.50.0040.00416.59
7.4.40.0030.01222.77
7.4.30.0040.01216.86
7.4.00.0090.00615.10
7.3.330.0000.00613.44
7.3.320.0000.00613.32
7.3.310.0070.00016.34
7.3.300.0000.00716.33
7.3.290.0100.01016.52
7.3.280.0080.00916.49
7.3.270.0140.00817.40
7.3.260.0120.00616.42
7.3.250.0090.01116.65
7.3.240.0130.00316.53
7.3.230.0080.01316.42
7.3.210.0100.00716.65
7.3.200.0140.00319.39
7.3.190.0070.01016.72
7.3.180.0120.00916.58
7.3.170.0150.00716.69
7.3.160.0130.00316.70
7.3.120.0040.01415.21
7.3.00.0070.00716.73
7.2.330.0070.01016.63
7.2.320.0060.01616.84
7.2.310.0150.00416.59
7.2.300.0030.01416.86
7.2.290.0100.00716.82
7.2.130.0070.00717.14
7.2.120.0060.01017.23
7.2.110.0030.01017.14
7.2.100.0000.01317.16
7.2.90.0040.00817.20
7.2.80.0040.00716.94
7.2.70.0070.00417.16
7.2.60.0050.01116.93
7.2.50.0060.00616.86
7.2.40.0040.01117.02
7.2.30.0030.00717.15
7.2.20.0070.00716.89
7.2.10.0070.01017.20
7.2.00.0030.01218.37
7.1.250.0090.00315.97
7.1.240.0070.00715.87
7.1.230.0070.00715.87
7.1.220.0090.00615.96
7.1.210.0150.00015.99
7.1.200.0060.00615.99
7.1.190.0120.00615.94
7.1.180.0040.00715.98
7.1.170.0090.00616.11
7.1.160.0080.00415.99
7.1.150.0040.00815.85
7.1.140.0040.01115.98
7.1.130.0060.00316.11
7.1.120.0070.01016.13
7.1.110.0040.00415.77
7.1.100.0020.01517.13
7.1.90.0100.00016.09
7.1.80.0090.00015.94
7.1.70.0050.00416.48
7.1.60.0100.01017.88
7.1.50.0020.01216.72
7.1.40.0110.00416.05
7.1.30.0030.00716.06
7.1.20.0000.01015.69
7.1.10.0040.01115.90
7.1.00.0090.03819.21
7.0.330.0070.00315.42
7.0.320.0000.01015.41
7.0.310.0000.00815.75
7.0.300.0060.00615.31
7.0.290.0060.00915.36
7.0.280.0040.01115.63
7.0.270.0070.00715.42
7.0.260.0090.00615.70
7.0.250.0060.00615.47
7.0.240.0100.00315.47
7.0.230.0050.00515.82
7.0.220.0030.01215.48
7.0.210.0060.00915.64
7.0.200.0040.00916.25
7.0.190.0030.00515.65
7.0.180.0030.01015.48
7.0.170.0060.00615.51
7.0.160.0070.01015.45
7.0.150.0070.00715.73
7.0.140.0050.03918.83
7.0.130.0110.00415.74
7.0.120.0030.00715.33
7.0.110.0000.01315.46
7.0.100.0060.00615.56
7.0.90.0030.01015.64
7.0.80.0070.00715.49
7.0.70.0030.01015.74
7.0.60.0030.05017.69
7.0.50.0030.04316.74
7.0.40.0100.03817.00
7.0.30.0200.02816.98
7.0.20.0150.02516.83
7.0.10.0200.03816.87
7.0.00.0060.04317.02
5.6.380.0000.01214.76
5.6.370.0030.01014.61
5.6.360.0100.00014.51
5.6.350.0060.00614.37
5.6.340.0090.00014.55
5.6.330.0040.00713.96
5.6.320.0030.01014.51
5.6.310.0060.00314.63
5.6.300.0110.00414.30
5.6.290.0070.00314.65
5.6.280.0020.04017.68
5.6.270.0040.00414.35
5.6.260.0030.00714.47
5.6.250.0030.00614.47
5.6.240.0070.00714.42
5.6.230.0070.00314.24
5.6.220.0050.00614.28
5.6.210.0050.03217.61
5.6.200.0030.04416.38
5.6.190.0080.03817.36
5.6.180.2110.02417.50
5.6.170.0140.03717.56
5.6.160.0060.04617.47
5.6.150.0040.04716.21
5.6.140.0040.02416.27
5.6.130.0060.04616.32
5.6.120.0100.04017.72
5.6.110.0060.02317.54
5.6.100.0120.03317.76
5.6.90.0100.02517.81
5.6.80.0100.03517.40
5.6.70.0170.02317.21
5.6.60.0030.01214.19
5.6.50.0070.00714.46
5.6.40.0030.01014.59
5.6.30.0060.00614.50
5.6.20.0060.00614.14
5.6.10.0090.00014.25
5.6.00.0040.00814.04
5.5.380.0000.00611.18
5.5.370.0040.00411.30
5.5.360.0000.01311.35
5.5.350.0080.04315.81
5.5.340.0020.02914.63
5.5.330.0020.03615.66
5.5.320.0160.04015.69
5.5.310.0150.01815.72
5.5.300.0030.03014.67
5.5.290.0070.02214.58
5.5.280.0070.03716.05
5.5.270.0030.02516.14
5.5.260.0100.03715.99
5.5.250.0050.04516.04
5.5.240.0080.03715.61
5.5.230.0070.00311.25
5.5.220.0030.00311.20
5.5.210.0040.00411.41
5.5.200.0080.00411.27
5.5.190.0040.00711.29
5.5.180.0040.00711.25
5.5.170.0070.00711.18
5.5.160.0000.00911.25
5.5.150.0030.00911.18
5.5.140.0030.00511.29
5.5.130.0030.00911.18
5.5.120.0000.01011.18
5.5.110.0000.00811.25
5.5.100.0000.01011.29
5.5.90.0040.00311.27
5.5.80.0020.00511.18
5.5.70.0030.00611.18
5.5.60.0000.01111.27
5.5.50.0000.01111.30
5.5.40.0000.01011.20
5.5.30.0060.00311.18
5.5.20.0090.00311.18
5.5.10.0030.00611.27
5.5.00.0030.00711.18
5.4.450.0380.02715.40
5.4.440.0300.02515.49
5.4.430.0790.00115.42
5.4.420.0830.00115.37
5.4.410.0020.03414.95
5.4.400.0020.03715.09
5.4.390.0060.03115.01
5.4.380.0180.03014.94
5.4.370.0100.03214.99
5.4.360.0110.02514.96
5.4.350.0160.02814.94
5.4.340.0120.03215.06
5.4.330.0060.00011.18
5.4.320.0070.01911.99
5.4.310.0070.01911.84
5.4.300.0030.02311.84
5.4.290.0060.03011.84
5.4.280.0070.01911.79
5.4.270.0040.02211.78
5.4.260.0020.02311.78
5.4.250.0040.02211.78
5.4.240.0040.02011.78
5.4.230.0040.02311.77
5.4.220.0070.01911.78
5.4.210.0020.02211.77
5.4.200.0070.02011.77
5.4.190.0050.02411.84
5.4.180.0020.02511.77
5.4.170.0050.02211.78
5.4.160.0050.02611.86
5.4.150.0040.02211.78
5.4.140.0070.01911.61
5.4.130.0050.01911.61
5.4.120.0040.02111.65
5.4.110.0070.02311.58
5.4.100.0050.02111.58
5.4.90.0070.01911.63
5.4.80.0040.02311.58
5.4.70.0030.02511.58
5.4.60.0050.02311.59
5.4.50.0040.02011.58
5.4.40.0090.01611.58
5.4.30.0020.02411.57
5.4.20.0060.01911.58
5.4.10.0030.02411.59
5.4.00.0050.02111.33
5.3.290.0040.02211.99
5.3.280.0040.02411.94
5.3.270.0060.02511.95
5.3.260.0060.02311.95
5.3.250.0040.02311.95
5.3.240.0070.02011.95
5.3.230.0080.01911.94
5.3.220.0090.01811.93
5.3.210.0070.02011.93
5.3.200.0030.02211.93
5.3.190.0050.02211.93
5.3.180.0030.02211.93
5.3.170.0020.02211.92
5.3.160.0060.02011.93
5.3.150.0050.02211.92
5.3.140.0040.02211.92
5.3.130.0080.02011.91
5.3.120.0070.02211.92
5.3.110.0060.02111.92
5.3.100.0050.02111.65
5.3.90.0070.02311.63
5.3.80.0080.02511.62
5.3.70.0050.01911.63
5.3.60.0140.01611.62
5.3.50.0060.02011.59
5.3.40.0070.01911.59
5.3.30.0050.02111.57
5.3.20.0060.02011.46
5.3.10.0030.02311.44
5.3.00.0020.02211.43
5.2.170.0040.02210.16
5.2.160.0040.01610.16
5.2.150.0050.01910.16
5.2.140.0060.01710.16
5.2.130.0050.01410.14
5.2.120.0030.01810.14
5.2.110.0020.01710.15
5.2.100.0030.01610.14
5.2.90.0020.01710.14
5.2.80.0050.01510.14
5.2.70.0030.01910.14
5.2.60.0040.02010.12
5.2.50.0040.01710.10
5.2.40.0020.01910.09
5.2.30.0090.01310.08
5.2.20.0020.01910.07
5.2.10.0020.01910.03
5.2.00.0020.0199.97
5.1.60.0050.0159.61
5.1.50.0060.0139.61
5.1.40.0040.0149.60
5.1.30.0020.0169.77
5.1.20.0050.0169.79
5.1.10.0030.0159.65
5.1.00.0020.0169.65
5.0.50.0050.0108.88
5.0.40.0040.0118.81
5.0.30.0030.0178.72
5.0.20.0040.0138.71
5.0.10.0040.0168.70
5.0.00.0050.0208.69
4.4.90.0010.0127.97
4.4.80.0020.0107.97
4.4.70.0010.0117.96
4.4.60.0020.0137.97
4.4.50.0030.0127.97
4.4.40.0020.0147.94
4.4.30.0010.0107.97
4.4.20.0020.0118.01
4.4.10.0020.0098.01
4.4.00.0020.0157.97
4.3.110.0020.0107.92
4.3.100.0020.0137.92
4.3.90.0020.0107.90
4.3.80.0040.0127.88
4.3.70.0030.0077.90
4.3.60.0010.0097.90
4.3.50.0020.0107.90
4.3.40.0020.0137.86
4.3.30.0050.0077.23
4.3.20.0020.0097.22
4.3.10.0040.0087.20
4.3.00.0030.00813.39

preferences:
29.82 ms | 401 KiB | 5 Q