3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string='bla bla xxx bla *xxx bla bla **xxx bla bla ***xxx bla bla ****xxx'; $search='xxx'; $char='*'; preg_replace_callback( '/(' . preg_quote($char) . '*)' . $search . '/', function($matches) { print strlen($matches[1]); if(strlen($matches[1]) % 2 !== 0) { return $matches[1] . '*'; } }, $string ); print $string;

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.00916.75
8.3.50.0130.00616.58
8.3.40.0040.01118.84
8.3.30.0110.00419.06
8.3.20.0000.00820.39
8.3.10.0040.00421.86
8.3.00.0050.00319.38
8.2.180.0140.00316.63
8.2.170.0140.00422.96
8.2.160.0100.00320.38
8.2.150.0080.00025.66
8.2.140.0000.00724.66
8.2.130.0040.00426.16
8.2.120.0050.00320.98
8.2.110.0060.00321.12
8.2.100.0110.00017.88
8.2.90.0030.00519.21
8.2.80.0060.00317.97
8.2.70.0040.00417.63
8.2.60.0000.00818.05
8.2.50.0040.00718.07
8.2.40.0030.00520.13
8.2.30.0030.00518.11
8.2.20.0040.00418.12
8.2.10.0050.00218.30
8.2.00.0000.00818.11
8.1.280.0150.00325.92
8.1.270.0060.01220.41
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00622.24
8.1.230.0090.00317.83
8.1.220.0000.00817.79
8.1.210.0080.00018.77
8.1.200.0000.01017.48
8.1.190.0000.00917.48
8.1.180.0050.00318.10
8.1.170.0000.00818.77
8.1.160.0070.00022.05
8.1.150.0000.00720.61
8.1.140.0040.00417.63
8.1.130.0030.00317.75
8.1.120.0000.00717.56
8.1.110.0000.00717.61
8.1.100.0000.00817.53
8.1.90.0000.00717.62
8.1.80.0050.00317.51
8.1.70.0000.00717.62
8.1.60.0050.00317.79
8.1.50.0080.00317.54
8.1.40.0030.00517.66
8.1.30.0030.00617.75
8.1.20.0040.00417.85
8.1.10.0040.00417.73
8.1.00.0060.00617.68
8.0.300.0030.00519.12
8.0.290.0000.00816.88
8.0.280.0030.00518.39
8.0.270.0000.00717.23
8.0.260.0030.00317.20
8.0.250.0000.00817.11
8.0.240.0030.00617.11
8.0.230.0030.00517.01
8.0.220.0000.00716.93
8.0.210.0000.00816.99
8.0.200.0030.00317.05
8.0.190.0050.00317.12
8.0.180.0060.00317.01
8.0.170.0050.00316.96
8.0.160.0000.00716.99
8.0.150.0000.00716.91
8.0.140.0000.00717.00
8.0.130.0030.00313.54
8.0.120.0000.00816.99
8.0.110.0020.00517.05
8.0.100.0080.00017.11
8.0.90.0000.00716.88
8.0.80.0120.00317.01
8.0.70.0000.00717.11
8.0.60.0000.00817.07
8.0.50.0050.00317.06
8.0.30.0080.00917.35
8.0.20.0110.00917.40
8.0.10.0000.00817.12
8.0.00.0140.00816.94
7.4.330.0050.00016.78
7.4.320.0030.00316.80
7.4.300.0090.00016.82
7.4.290.0000.00716.84
7.4.280.0050.00216.64
7.4.270.0070.00016.79
7.4.260.0000.00816.83
7.4.250.0050.00216.68
7.4.240.0040.00316.71
7.4.230.0040.00416.90
7.4.220.0130.00616.78
7.4.210.0090.00816.88
7.4.200.0070.00016.93
7.4.160.0040.01116.54
7.4.150.0050.01117.40
7.4.140.0130.00917.86
7.4.130.0170.00916.81
7.4.120.0090.00916.94
7.4.110.0110.01016.86
7.4.100.0170.00716.72
7.4.90.0100.00716.75
7.4.80.0070.01019.39
7.4.70.0110.00616.78
7.4.60.0060.01016.74
7.4.50.0000.00716.55
7.4.40.0070.00816.68
7.4.30.0050.01116.55
7.4.00.0090.00614.89
7.3.330.0030.00313.48
7.3.320.0030.00313.55
7.3.310.0040.00416.56
7.3.300.0030.00316.57
7.3.290.0040.00216.33
7.3.280.0070.00916.41
7.3.270.0080.01117.40
7.3.260.0090.00916.52
7.3.240.0170.00016.53
7.3.230.0160.00916.69
7.3.210.0100.00716.54
7.3.200.0150.00319.39
7.3.190.0100.01016.81
7.3.180.0030.01316.84
7.3.170.0130.00516.59
7.3.160.0090.00616.55
7.3.10.0030.01016.90
7.3.00.0030.01016.83
7.2.330.0060.01216.86
7.2.320.0110.01116.86
7.2.310.0110.00616.86
7.2.300.0150.00416.93
7.2.290.0150.00316.94
7.2.130.0040.01117.13
7.2.120.0030.01217.11
7.2.110.0080.00416.98
7.2.100.0000.01517.12
7.2.90.0030.01416.92
7.2.80.0040.01116.89
7.2.70.0090.00916.89
7.2.60.0060.00917.15
7.2.50.0120.00917.11
7.2.40.0040.01117.16
7.2.30.0000.01117.09
7.2.20.0090.00617.31
7.2.10.0090.00017.21
7.2.00.0090.00618.25
7.1.250.0070.00315.91
7.1.200.0030.00316.15
7.1.100.0070.00718.32
7.1.70.0090.00017.10
7.1.60.0120.01219.59
7.1.50.0070.01717.16
7.1.00.0000.08022.38
7.0.200.0000.00716.93
7.0.60.0030.08319.98
7.0.50.0070.08317.86
7.0.40.0070.05320.14
7.0.30.0100.04720.18
7.0.20.0300.07320.20
7.0.10.0230.03320.24
7.0.00.0170.05320.21
5.6.280.0030.07321.12
5.6.210.0030.07720.48
5.6.200.0100.03718.22
5.6.190.0030.04320.47
5.6.180.3830.04720.64
5.6.170.0200.03720.47
5.6.160.0030.08720.57
5.6.150.0070.08318.18
5.6.140.0030.08318.14
5.6.130.0100.04318.12
5.6.120.0000.05321.05
5.6.110.0000.06021.09
5.6.100.0100.08020.98
5.6.90.0030.07720.97
5.6.80.0070.04020.39
5.6.70.4100.03320.50
5.5.350.0270.07320.45
5.5.340.0070.06017.95
5.5.330.0070.08720.28
5.5.320.0400.07020.42
5.5.310.0270.07320.28
5.5.300.0100.05317.91
5.5.290.0100.08018.06
5.5.280.0030.08320.89
5.5.270.0070.08720.96
5.5.260.0070.04020.84
5.5.250.0000.07320.47
5.5.240.0000.07320.26
5.4.450.0930.04019.42
5.4.440.0130.06319.39
5.4.430.0670.05319.52
5.4.420.0700.05019.46
5.4.410.0630.05719.39
5.4.400.0730.07019.15
5.4.390.0870.07018.97
5.4.380.0900.06319.16
5.4.370.1070.05319.20
5.4.360.0630.05719.14
5.4.350.0830.05319.18
5.4.340.0570.06319.05
5.4.320.0700.05019.07
5.4.310.0130.05018.91
5.4.300.0070.05319.09
5.4.290.0470.05319.27
5.4.280.0900.06319.13
5.4.270.0700.05718.97
5.4.260.0630.05718.89
5.4.250.0830.07719.19
5.4.240.0770.04719.03
5.4.230.0630.05318.98
5.4.220.0370.05318.89
5.4.210.0300.05318.97
5.4.200.0230.06016.85
5.4.190.0300.05019.18
5.4.180.0230.05719.09
5.4.170.0270.06019.15
5.4.160.0230.04319.23
5.4.150.0330.04318.88
5.4.140.0170.07316.48
5.4.130.0170.05716.25
5.4.120.0230.04716.63
5.4.110.0130.05716.58
5.4.100.0170.05316.42
5.4.90.0300.05016.44
5.4.80.0230.06716.33
5.4.70.0300.06016.39
5.4.60.0230.06316.55
5.4.50.0170.04716.45
5.4.40.0130.05316.48
5.4.30.0100.05316.24
5.4.20.0200.05316.21
5.4.10.0230.06316.21
5.4.00.0270.05016.13
5.3.290.0170.07014.66
5.3.280.0170.05014.68
5.3.270.0170.05014.83
5.3.260.0130.07014.63
5.3.250.0130.05014.81
5.3.240.0100.05714.52
5.3.230.0200.05014.57
5.3.220.0230.04714.48
5.3.210.0270.06014.63
5.3.200.0330.05014.79
5.3.190.0200.06314.79
5.3.180.0230.06714.67
5.3.170.0200.05714.52
5.3.160.0270.06714.65
5.3.150.0170.06714.67
5.3.140.0100.05714.55
5.3.130.0270.06014.52
5.3.120.0170.06714.76
5.3.110.0230.05014.52
5.3.100.0200.05014.21
5.3.90.0170.05713.94
5.3.80.0230.05014.20
5.3.70.0200.05314.20
5.3.60.0170.05014.05
5.3.50.0170.05014.12
5.3.40.0170.05014.02
5.3.30.0200.04713.96
5.3.20.0070.05713.74
5.3.10.0170.05013.70
5.3.00.0170.05013.60
5.2.170.0100.04711.04
5.2.160.0030.04711.04
5.2.150.0170.03311.24
5.2.140.0230.05011.00
5.2.130.0170.05310.96
5.2.120.0330.03710.89
5.2.110.0070.04311.02
5.2.100.0030.04311.00
5.2.90.0100.04011.00
5.2.80.0270.04311.04
5.2.70.0230.05310.88
5.2.60.0130.05710.99
5.2.50.0200.05011.02
5.2.40.0270.03710.90
5.2.30.0230.04310.80
5.2.20.0070.04310.82
5.2.10.0170.03310.80
5.2.00.0170.03310.74
5.1.60.0130.0409.89
5.1.50.0100.0379.93
5.1.40.0000.04010.01
5.1.30.0070.05010.41
5.1.20.0100.03710.29
5.1.10.0030.0409.94
5.1.00.0100.03710.15
5.0.50.0030.0308.54
5.0.40.0070.0238.35
5.0.30.0070.0408.29
5.0.20.0000.0408.20
5.0.10.0030.0308.07
5.0.00.0030.0478.02
4.4.90.0030.0235.87
4.4.80.0030.0235.79
4.4.70.0070.0235.77
4.4.60.0100.0175.79
4.4.50.0070.0205.82
4.4.40.0030.0405.79
4.4.30.0100.0275.90
4.4.20.0000.0335.90
4.4.10.0070.0205.92
4.4.00.0100.0305.79
4.3.110.0030.0275.73
4.3.100.0100.0235.77
4.3.90.0130.0205.66
4.3.80.0000.0435.74
4.3.70.0100.0205.83
4.3.60.0100.0205.64
4.3.50.0030.0235.65
4.3.40.0130.0335.79
4.3.30.0000.0304.41
4.3.20.0030.0274.54
4.3.10.0070.0234.36
4.3.00.0370.01316.61

preferences:
67.5 ms | 400 KiB | 5 Q