3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Function to create a dynamic replacement. * @param array $match An array with the match of the pattern. * @return string The replacement. */ function getReplacement($match) { if (isset($match[0])) { return $match[0].'<br/>'; } } //the value to replace specific parts. $string = 'Tip #1 some #12 random #123 text #1234, an #12345 example #123456'; //replace all parts starting with '#' and three numbers following. echo preg_replace_callback('/#[0-9]+/', 'getReplacement', $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.80.0000.01016.50
8.3.70.0120.00616.88
8.3.60.0120.00618.43
8.3.50.0130.00622.05
8.3.40.0000.01418.84
8.3.30.0070.00718.97
8.3.20.0040.00420.16
8.3.10.0090.00023.53
8.3.00.0050.00320.89
8.2.200.0060.00316.63
8.2.190.0140.00717.00
8.2.180.0060.01525.92
8.2.170.0200.00019.21
8.2.160.0170.00322.96
8.2.150.0050.00225.66
8.2.140.0190.00324.66
8.2.130.0080.00026.16
8.2.120.0080.00019.89
8.2.110.0100.00721.19
8.2.100.0060.00617.97
8.2.90.0100.00017.75
8.2.80.0080.00019.08
8.2.70.0030.00618.00
8.2.60.0000.00817.75
8.2.50.0030.00617.88
8.2.40.0000.00820.59
8.2.30.0030.00520.53
8.2.20.0020.00517.82
8.2.10.0000.00718.14
8.2.00.0070.00017.99
8.1.290.0090.00030.84
8.1.280.0130.00325.92
8.1.270.0040.00423.99
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0050.00520.81
8.1.230.0090.00617.82
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0090.00017.48
8.1.190.0060.00317.48
8.1.180.0000.01118.10
8.1.170.0040.00418.76
8.1.160.0040.00420.98
8.1.150.0040.00418.86
8.1.140.0040.00419.66
8.1.130.0000.00717.62
8.1.120.0000.00717.62
8.1.110.0040.00417.49
8.1.100.0070.00017.50
8.1.90.0040.00417.61
8.1.80.0040.00417.52
8.1.70.0040.00417.47
8.1.60.0030.00617.64
8.1.50.0000.00917.72
8.1.40.0000.00917.63
8.1.30.0040.00417.82
8.1.20.0090.00017.77
8.1.10.0030.00617.54
8.1.00.0040.00417.64
8.0.300.0040.00418.77
8.0.290.0000.00916.75
8.0.280.0070.00018.43
8.0.270.0030.00317.29
8.0.260.0000.00617.29
8.0.250.0000.00716.98
8.0.240.0000.00717.13
8.0.230.0030.00317.11
8.0.220.0030.00516.92
8.0.210.0060.00317.06
8.0.200.0050.00317.11
8.0.190.0050.00217.00
8.0.180.0030.00617.00
8.0.170.0040.00417.00
8.0.160.0040.00417.18
8.0.150.0040.00417.00
8.0.140.0070.00017.02
8.0.130.0060.00013.39
8.0.120.0050.00316.92
8.0.110.0070.00017.00
8.0.100.0000.00716.95
8.0.90.0040.00416.84
8.0.80.0070.01016.97
8.0.70.0090.00017.03
8.0.60.0000.00716.88
8.0.50.0030.00616.86
8.0.30.0130.00517.36
8.0.20.0100.01017.44
8.0.10.0040.00416.97
8.0.00.0140.01016.96
7.4.330.0000.00515.08
7.4.320.0000.00616.66
7.4.300.0030.00316.75
7.4.290.0040.00416.61
7.4.280.0000.00816.65
7.4.270.0070.00016.59
7.4.260.0040.00416.66
7.4.250.0030.00616.73
7.4.240.0030.00316.72
7.4.230.0070.00016.59
7.4.220.0150.00616.76
7.4.210.0110.00716.69
7.4.200.0040.00416.77
7.4.160.0080.00816.66
7.4.150.0110.00717.40
7.4.140.0060.01217.86
7.4.130.0090.00916.53
7.4.120.0110.00716.65
7.4.110.0090.00916.70
7.4.100.0150.00616.57
7.4.90.0130.00616.74
7.4.80.0100.00719.39
7.4.70.0000.01616.78
7.4.60.0090.00916.71
7.4.50.0060.00616.68
7.4.40.0100.00716.70
7.4.30.0070.01716.54
7.4.00.0040.01515.20
7.3.330.0050.00013.28
7.3.320.0060.00013.33
7.3.310.0040.00416.52
7.3.300.0030.00316.57
7.3.290.0070.01416.40
7.3.280.0110.01216.44
7.3.270.0110.00617.40
7.3.260.0060.01316.39
7.3.250.0110.00616.56
7.3.240.0080.01116.59
7.3.230.0090.00616.46
7.3.210.0000.01916.47
7.3.200.0160.00016.79
7.3.190.0060.00916.70
7.3.180.0090.00616.70
7.3.170.0190.00616.78
7.3.160.0070.01016.50
7.3.120.0030.00915.23
7.3.110.0080.00815.00
7.3.100.0130.00014.79
7.3.90.0040.01414.66
7.3.80.0000.00814.70
7.3.70.0130.00014.61
7.3.60.0040.00414.78
7.3.50.0070.00714.98
7.3.40.0100.00314.88
7.3.30.0070.00715.03
7.3.20.0060.01016.52
7.3.10.0060.00316.96
7.3.00.0100.00616.58
7.2.330.0100.00716.63
7.2.320.0100.01016.77
7.2.310.0080.00816.91
7.2.300.0130.00316.85
7.2.290.0030.01316.68
7.2.240.0070.01115.26
7.2.230.0030.01014.98
7.2.220.0000.01515.33
7.2.210.0070.01015.09
7.2.200.0000.01414.94
7.2.190.0060.00915.15
7.2.180.0000.01514.82
7.2.170.0090.00315.00
7.2.160.0090.00915.22
7.2.150.0090.00916.88
7.2.140.0060.00617.05
7.2.130.0040.01117.21
7.2.120.0030.01017.11
7.2.110.0060.00616.96
7.2.100.0040.00817.25
7.2.90.0030.00917.16
7.2.80.0080.00516.86
7.2.70.0000.00917.07
7.2.60.0040.00917.09
7.2.50.0030.01317.06
7.2.40.0070.01117.11
7.2.30.0030.01017.08
7.2.20.0050.00516.75
7.2.10.0030.00717.07
7.2.00.0050.01018.26
7.1.330.0060.00915.85
7.1.320.0000.01516.06
7.1.310.0080.00416.02
7.1.300.0000.01216.02
7.1.290.0000.00915.80
7.1.280.0050.01016.13
7.1.270.0070.01015.68
7.1.260.0090.00315.73
7.1.250.0070.01015.89
7.1.200.0000.01315.69
7.1.100.0000.01318.50
7.1.70.0000.00817.41
7.1.60.0030.00717.52
7.1.00.0070.07022.55
7.0.200.0060.00916.84
7.0.60.0000.08321.72
7.0.50.0130.07317.90
7.0.40.0230.06020.20
7.0.30.0330.05020.20
7.0.20.0130.05720.20
7.0.10.0170.06320.39
7.0.00.0170.06320.14
5.6.280.0100.06720.82
5.6.210.0030.08720.70
5.6.200.0170.07318.16
5.6.190.0230.05320.60
5.6.180.0270.05320.52
5.6.170.0230.05020.77
5.6.160.0200.05720.47
5.6.150.0170.06720.34
5.6.140.0230.06020.41
5.6.130.0130.07020.41
5.6.120.0670.08020.59
5.6.110.0230.05320.30
5.6.100.0230.06020.58
5.6.90.0170.07320.31
5.6.80.0200.06019.78
5.6.70.0130.05719.57
5.6.60.0270.07019.96
5.6.50.0200.05719.82
5.6.40.0230.05719.57
5.6.30.0270.05319.76
5.6.20.0030.06319.95
5.6.10.0230.05319.77
5.6.00.0170.06019.77
5.5.350.0200.07720.42
5.5.340.0130.04317.96
5.5.330.0170.06020.57
5.5.320.0170.06020.42
5.5.310.0200.05320.36
5.5.300.0270.05320.21
5.5.290.0130.06320.20
5.5.280.0400.08320.16
5.5.270.0200.05020.00
5.5.260.0100.06720.20
5.5.250.0630.05020.00
5.5.240.0170.06719.55
5.5.230.0100.06019.77
5.5.220.0170.05319.62
5.5.210.0300.07019.77
5.5.200.0230.05319.57
5.5.190.0230.07019.46
5.5.180.0230.05319.48
5.5.160.0200.05719.50
5.5.150.0170.05719.74
5.5.140.0270.05019.54
5.5.130.0300.05719.57
5.5.120.0100.06319.59
5.5.110.0200.06019.51
5.5.100.0200.06019.36
5.5.90.0570.06019.46
5.5.80.0530.05719.46
5.5.70.0170.08719.41
5.5.60.0070.06019.44
5.5.50.0270.04719.46
5.5.40.0400.05319.44
5.5.30.0200.04719.37
5.5.20.0130.06019.47
5.5.10.0200.05019.43
5.5.00.0370.06719.45

preferences:
29.7 ms | 401 KiB | 5 Q