3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "/companies/(\d+)/adverts/new/(\d+)/(\d+)/"; $replace = array(2223, 'generic'); $result = vsprintf(preg_replace('#\((.*?)\)#', '%s', $string, count($replace)), $replace); var_dump($result);

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.0070.00718.55
8.3.50.0100.00622.05
8.3.40.0090.01218.97
8.3.30.0110.00719.10
8.3.20.0070.00020.18
8.3.10.0000.00822.12
8.3.00.0070.00022.52
8.2.180.0100.01316.63
8.2.170.0110.00422.96
8.2.160.0100.00720.81
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0060.01326.16
8.2.120.0080.00017.50
8.2.110.0040.00422.29
8.2.100.0090.00319.57
8.2.90.0000.00819.05
8.2.80.0040.00417.97
8.2.70.0060.00317.63
8.2.60.0060.00317.80
8.2.50.0000.00818.07
8.2.40.0000.00718.03
8.2.30.0040.00418.09
8.2.20.0040.00417.80
8.2.10.0040.00417.81
8.2.00.0040.00417.83
8.1.280.0030.01025.92
8.1.270.0080.00022.18
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0060.00323.96
8.1.230.0060.00619.06
8.1.220.0000.00817.74
8.1.210.0080.00018.77
8.1.200.0100.00017.47
8.1.190.0000.00817.16
8.1.180.0000.00818.75
8.1.170.0000.00818.75
8.1.160.0040.00421.91
8.1.150.0080.00018.80
8.1.140.0070.00017.54
8.1.130.0000.00717.83
8.1.120.0000.00717.65
8.1.110.0050.00317.50
8.1.100.0000.00717.49
8.1.90.0070.00017.59
8.1.80.0030.00417.60
8.1.70.0030.00317.46
8.1.60.0080.00017.78
8.1.50.0040.00417.65
8.1.40.0080.00017.59
8.1.30.0050.00317.65
8.1.20.0040.00417.75
8.1.10.0040.00417.57
8.1.00.0050.00217.50
8.0.300.0060.00318.77
8.0.290.0080.00017.18
8.0.280.0000.00718.45
8.0.270.0000.00817.17
8.0.260.0030.00316.91
8.0.250.0000.00717.03
8.0.240.0080.00017.06
8.0.230.0000.00716.93
8.0.220.0000.00716.87
8.0.210.0040.00416.95
8.0.200.0000.00816.99
8.0.190.0000.00717.03
8.0.180.0030.00516.93
8.0.170.0040.00417.12
8.0.160.0040.00416.97
8.0.150.0050.00217.11
8.0.140.0030.00317.02
8.0.130.0040.00413.41
8.0.120.0040.00417.01
8.0.110.0080.00016.96
8.0.100.0070.00016.95
8.0.90.0040.00416.92
8.0.80.0070.00817.08
8.0.70.0000.00717.10
8.0.60.0080.00017.00
8.0.50.0000.00816.85
8.0.30.0110.00917.16
8.0.20.0060.01417.41
8.0.10.0040.00417.11
8.0.00.0080.01016.71
7.4.330.0020.00215.00
7.4.320.0000.00716.85
7.4.300.0030.00316.79
7.4.290.0030.00316.72
7.4.280.0030.00516.63
7.4.270.0000.00616.71
7.4.260.0040.00416.73
7.4.250.0040.00416.77
7.4.240.0030.00616.73
7.4.230.0030.00316.63
7.4.220.0070.01016.84
7.4.210.0060.01116.79
7.4.200.0000.00716.79
7.4.190.0090.00016.85
7.4.160.0100.00716.70
7.4.150.0100.00717.40
7.4.140.0140.00817.86
7.4.130.0080.01016.69
7.4.120.0110.00716.69
7.4.110.0060.01616.64
7.4.100.0140.00316.80
7.4.90.0040.01416.70
7.4.80.0090.00919.39
7.4.70.0150.00416.78
7.4.60.0160.00716.90
7.4.50.0060.00316.48
7.4.40.0090.00622.77
7.4.30.0100.00716.49
7.4.00.0080.00415.31
7.3.330.0030.00313.08
7.3.320.0030.00313.14
7.3.310.0030.00316.29
7.3.300.0030.00316.37
7.3.290.0060.01016.39
7.3.280.0060.01316.33
7.3.270.0120.00617.40
7.3.260.0220.01116.49
7.3.250.0120.00516.40
7.3.240.0100.00716.45
7.3.230.0130.00316.45
7.3.210.0100.00716.73
7.3.200.0160.00619.39
7.3.190.0090.01316.61
7.3.180.0090.00616.48
7.3.170.0110.01116.51
7.3.160.0060.01016.38
7.3.120.0030.01214.89
7.3.10.0070.00316.98
7.3.00.0040.00416.50
7.2.330.0070.01116.70
7.2.320.0100.01316.73
7.2.310.0090.00916.87
7.2.300.0130.00316.70
7.2.290.0100.00716.83
7.2.130.0090.00616.98
7.2.120.0030.00816.87
7.2.110.0030.01017.17
7.2.100.0090.00416.85
7.2.90.0080.00317.11
7.2.80.0040.00816.88
7.2.70.0100.00316.95
7.2.60.0060.00617.09
7.2.50.0080.00417.14
7.2.40.0030.00917.12
7.2.30.0070.00716.97
7.2.20.0060.01216.87
7.2.10.0110.00716.92
7.2.00.0080.00518.15
7.1.250.0030.00615.62
7.1.200.0090.00615.91
7.1.70.0000.01117.21
7.1.60.0140.00715.65
7.1.50.0100.01317.22
7.1.00.0000.08022.27
7.0.200.0000.01016.79
7.0.140.0070.07021.93
7.0.60.0170.07320.04
7.0.50.0130.07717.89
7.0.40.0000.04720.32
7.0.30.0130.04720.02
7.0.20.0370.05720.22
7.0.10.0400.06720.31
7.0.00.0100.06020.02
5.6.280.0000.07321.06
5.6.210.0070.08320.64
5.6.200.0070.04018.15
5.6.190.0100.06720.64
5.6.180.3270.03720.41
5.6.170.0430.05020.41
5.6.160.0130.08320.54
5.6.150.0170.06018.13
5.6.140.0030.07318.18
5.6.130.0070.03718.22
5.6.120.0070.09721.00
5.6.110.0030.08721.11
5.6.100.0070.04020.97
5.6.90.0030.07720.84
5.6.80.0130.07720.27
5.6.70.0200.06320.36
5.5.350.0000.08320.52
5.5.340.0070.06317.97
5.5.330.0100.05320.19
5.5.320.0200.05020.31
5.5.310.0270.05020.34
5.5.300.0030.08317.91
5.5.290.0170.04717.92
5.5.280.0070.04320.80
5.5.270.0030.06720.83
5.5.260.0130.03720.82
5.5.250.0100.07320.75
5.5.240.0170.05320.06
5.4.450.0130.06319.55
5.4.440.0370.06319.32
5.4.430.0070.07019.52
5.4.420.0200.05019.45
5.4.410.0130.06019.30
5.4.400.1400.00018.83
5.4.390.1600.00018.61
5.4.380.0300.04718.59
5.4.370.0100.05718.47
5.4.360.0170.05018.78
5.4.350.0130.06318.70
5.4.340.0500.06018.68
5.4.320.0050.03812.46
5.4.310.0030.04112.45
5.4.300.0050.04512.45
5.4.290.0110.03212.45
5.4.280.0060.04012.35
5.4.270.0050.03812.35
5.4.260.0100.05318.74
5.4.250.0170.07018.63
5.4.240.0230.06718.61
5.4.230.0130.07718.72
5.4.220.0130.07019.01
5.4.210.0130.06318.92
5.4.200.0170.07718.75
5.4.190.0100.08018.62
5.4.180.0100.05718.66
5.4.170.0300.06718.91
5.4.160.0230.06018.75
5.4.150.0100.05718.59
5.4.140.0130.07016.48
5.4.130.0100.05316.19
5.4.120.0070.05316.50
5.4.110.0100.05016.45
5.4.100.0170.06316.25
5.4.90.0200.06316.48
5.4.80.0130.04716.40
5.4.70.0230.06016.41
5.4.60.0130.04316.37
5.4.50.0070.04716.31
5.4.40.0070.07316.28
5.4.30.0070.05016.38
5.4.20.0130.05716.45
5.4.10.0030.08016.38
5.4.00.0170.05015.93
5.3.290.0100.04312.80
5.3.280.0070.07714.29
5.3.270.0130.05314.60
5.3.260.0230.06314.49
5.3.250.0200.04314.62
5.3.240.0070.06714.47
5.3.230.0130.05714.60
5.3.220.0230.04714.72
5.3.210.0070.05314.41
5.3.200.0070.06314.58
5.3.190.0230.04014.27
5.3.180.0030.07014.43
5.3.170.0170.06314.40
5.3.160.0230.06014.72
5.3.150.0070.07014.51
5.3.140.0130.04714.60
5.3.130.0100.07014.54
5.3.120.0170.05014.64
5.3.110.0030.07714.55
5.3.100.0130.07013.88
5.3.90.0070.05013.93
5.3.80.0100.05014.16
5.3.70.0070.06714.01
5.3.60.0100.07013.84
5.3.50.0030.07713.95
5.3.40.0170.05713.65
5.3.30.0170.05013.91
5.3.20.0070.06713.61
5.3.10.0070.05313.70
5.3.00.0130.05713.58
5.2.170.0130.05711.10
5.2.160.0070.04311.26
5.2.150.0030.06711.25
5.2.140.0070.04711.15
5.2.130.0030.06011.04
5.2.120.0130.04011.19
5.2.110.0000.06311.00
5.2.100.0030.05311.00
5.2.90.0030.04311.12
5.2.80.0130.05010.98
5.2.70.0030.05011.02
5.2.60.0100.04711.06
5.2.50.0100.04011.12
5.2.40.0070.04011.00
5.2.30.0070.05711.07
5.2.20.0200.05010.79
5.2.10.0130.03310.76
5.2.00.0030.05310.89
5.1.60.0070.0309.82
5.1.50.0070.0439.96
5.1.40.0030.0439.96
5.1.30.0030.04310.38
5.1.20.0030.04010.24
5.1.10.0030.05010.30
5.1.00.0070.0339.89
5.0.50.0030.0339.49
5.0.40.0030.0409.49
5.0.30.0030.0479.49
5.0.20.0000.0439.49
5.0.10.0000.0309.49
5.0.00.0070.0579.49
4.4.90.0070.0279.49
4.4.80.0070.0239.49
4.4.70.0030.0209.49
4.4.60.0070.0179.49
4.4.50.0000.0239.49
4.4.40.0000.0379.49
4.4.30.0000.0279.49
4.4.20.0000.0339.49
4.4.10.0030.0309.49
4.4.00.0100.0409.49
4.3.110.0000.0239.49
4.3.100.0000.0239.49
4.3.90.0000.0239.49
4.3.80.0100.0279.49
4.3.70.0000.0239.49
4.3.60.0030.0209.49
4.3.50.0000.0309.49
4.3.40.0100.0379.49
4.3.30.0030.0279.49
4.3.20.0000.0279.49
4.3.10.0100.0209.49
4.3.00.0000.0237.80

preferences:
64.03 ms | 401 KiB | 5 Q