3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'print the imprint with the imprinted printing paper'; $replacements = array( 'print' => 'imprint', 'imprint' => 'print', 'paper' => 'machine' ); $delimiter = '/'; $words = array_keys( $replacements); $regex = $delimiter . '\b(' . implode('|', array_map( 'preg_quote', $words, array_fill( 0, count( $words), $delimiter))) . ')\b' . $delimiter; $result = preg_replace_callback( $regex, function( $match) use( $replacements) { return $replacements[$match[1]]; }, $string); echo $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.0130.00616.63
8.3.50.0070.00916.64
8.3.40.0070.00719.04
8.3.30.0000.01418.75
8.3.20.0050.00319.02
8.3.10.0040.00419.02
8.3.00.0100.01019.43
8.2.180.0100.01316.88
8.2.170.0060.01219.21
8.2.160.0080.00822.96
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0030.00619.73
8.2.110.0030.00620.54
8.2.100.0030.00918.03
8.2.90.0050.00318.22
8.2.80.0050.00318.16
8.2.70.0080.00017.75
8.2.60.0050.00518.00
8.2.50.0000.00818.00
8.2.40.0030.00619.91
8.2.30.0000.00718.05
8.2.20.0090.00017.79
8.2.10.0000.00817.99
8.2.00.0040.00417.94
8.1.280.0120.00925.92
8.1.270.0090.00022.11
8.1.260.0030.00526.35
8.1.250.0070.00028.09
8.1.240.0100.00019.26
8.1.230.0120.00022.66
8.1.220.0040.00417.77
8.1.210.0060.00318.91
8.1.200.0000.00817.48
8.1.190.0080.00017.35
8.1.180.0040.00418.10
8.1.170.0000.00818.91
8.1.160.0000.00718.98
8.1.150.0000.00718.73
8.1.140.0030.00717.50
8.1.130.0040.00419.38
8.1.120.0000.00717.52
8.1.110.0070.00017.65
8.1.100.0050.00317.65
8.1.90.0080.00017.53
8.1.80.0040.00417.68
8.1.70.0050.00217.65
8.1.60.0050.00317.64
8.1.50.0000.00817.56
8.1.40.0040.00417.70
8.1.30.0000.00917.73
8.1.20.0000.01117.87
8.1.10.0040.00417.72
8.1.00.0030.00617.73
8.0.300.0000.00719.83
8.0.290.0040.00416.75
8.0.280.0080.00018.39
8.0.270.0000.00718.21
8.0.260.0030.00316.97
8.0.250.0040.00417.16
8.0.240.0040.00417.11
8.0.230.0030.00517.04
8.0.220.0000.00716.95
8.0.210.0000.00816.98
8.0.200.0070.00017.13
8.0.190.0060.00317.12
8.0.180.0030.00617.05
8.0.170.0040.00417.05
8.0.160.0060.00317.00
8.0.150.0040.00416.82
8.0.140.0050.00317.02
8.0.130.0030.00513.47
8.0.120.0040.00416.99
8.0.110.0000.00717.02
8.0.100.0040.00417.16
8.0.90.0070.00016.94
8.0.80.0000.02117.02
8.0.70.0040.00416.94
8.0.60.0030.00616.89
8.0.50.0050.00316.99
8.0.30.0070.01117.10
8.0.20.0090.01017.34
8.0.10.0070.00017.21
8.0.00.0140.00817.04
7.4.330.0020.00213.22
7.4.320.0030.00316.74
7.4.300.0060.00016.73
7.4.290.0030.00316.62
7.4.280.0040.00416.80
7.4.270.0000.00716.69
7.4.260.0060.00013.49
7.4.250.0030.00616.76
7.4.240.0000.00816.83
7.4.230.0000.00716.73
7.4.220.0130.01316.76
7.4.210.0090.00616.79
7.4.200.0000.00716.83
7.4.190.0000.00816.68
7.4.160.0100.00616.82
7.4.150.0100.00716.65
7.4.140.0180.00317.86
7.4.130.0120.00816.65
7.4.120.0070.01116.68
7.4.110.0120.00816.88
7.4.100.0100.00716.70
7.4.90.0060.01216.70
7.4.80.0130.00619.39
7.4.70.0130.01016.60
7.4.60.0090.00616.62
7.4.50.0050.00316.64
7.4.40.0090.00616.71
7.4.30.0110.00616.69
7.4.00.0030.01215.20
7.3.330.0060.00013.51
7.3.320.0050.00013.45
7.3.310.0030.00316.38
7.3.300.0000.00616.41
7.3.290.0080.01016.48
7.3.280.0040.01116.32
7.3.270.0160.00316.49
7.3.260.0070.01016.71
7.3.240.0100.00716.71
7.3.230.0040.01216.76
7.3.210.0060.01116.75
7.3.200.0150.00616.52
7.3.190.0030.01416.84
7.3.180.0040.01416.50
7.3.170.0130.00316.69
7.3.160.0100.00716.49
7.3.120.0060.00914.91
7.2.330.0120.00616.95
7.2.320.0090.01617.04
7.2.310.0100.01316.93
7.2.300.0120.00616.80
7.2.290.0060.01316.84
7.2.60.0070.00717.09
7.1.200.0040.00415.62
7.1.70.0000.00817.50
7.1.60.0070.01719.21
7.1.50.0070.01317.23
7.1.00.0000.06322.32
7.0.200.0040.00816.94
7.0.140.0200.05722.17
7.0.120.0000.03321.98
7.0.60.0000.07321.80
7.0.50.0100.08317.89
7.0.40.0100.04020.22
7.0.30.0270.04020.26
7.0.20.0230.05020.11
7.0.10.0070.05020.19
7.0.00.0100.06720.20
5.6.280.0000.07720.80
5.6.210.0000.04320.51
5.6.200.0030.04018.16
5.6.190.0030.09720.39
5.6.180.0270.07020.52
5.6.170.0300.03720.55
5.6.160.0030.06720.55
5.6.150.0070.06318.20
5.6.140.0030.08718.23
5.6.130.0000.04318.12
5.6.120.0030.07721.02
5.6.110.0070.05720.89
5.6.100.0030.04020.98
5.6.90.0030.07020.87
5.6.80.0100.07320.38
5.5.350.0100.07720.53
5.5.340.0070.07318.07
5.5.330.0100.08720.57
5.5.320.0200.05720.34
5.5.310.0300.08320.19
5.5.300.0030.06717.98
5.5.290.0130.07318.03
5.5.280.0030.08320.88
5.5.270.0170.06720.72
5.5.260.0000.04320.89
5.5.250.0100.08320.76
5.5.240.0230.07020.33
5.4.450.0100.05019.47
5.4.440.0000.09319.48
5.4.430.0130.07719.24
5.4.420.0070.08019.56
5.4.410.0070.08019.07
5.4.400.0130.04019.25
5.4.390.0070.08319.15
5.4.380.0100.08019.27
5.4.370.0170.06719.24
5.4.360.0170.06318.85
5.4.350.0000.05319.21
5.4.340.0030.04019.15
5.4.320.0030.03719.20
5.4.310.0030.03719.15
5.4.300.0000.04319.00
5.4.290.0100.03018.87
5.4.280.0030.03718.85
5.4.270.0030.03718.97
5.4.260.0030.03719.15
5.4.250.0070.03318.84
5.4.240.0070.03319.07
5.4.230.0000.04019.23
5.4.220.0000.04019.23
5.4.210.0100.03018.85
5.4.200.0070.03319.24
5.4.190.0000.04019.10
5.4.180.0030.03719.23
5.4.170.0070.03319.11
5.4.160.0030.03719.06
5.4.150.0000.04019.13
5.4.140.0000.03716.50
5.4.130.0070.03316.34
5.4.120.0070.03016.36
5.4.110.0070.03016.28
5.4.100.0100.03016.49
5.4.90.0030.03316.49
5.4.80.0030.05316.41
5.4.70.0000.04016.38
5.4.60.0000.05716.25
5.4.50.0030.03716.51
5.4.40.0030.05716.44
5.4.30.0030.04716.64
5.4.20.0000.04716.46
5.4.10.0070.06716.27
5.4.00.0100.06315.84
5.3.290.0000.04014.55
5.3.280.0030.04014.61
5.3.270.0100.04714.64
5.3.260.0100.03014.68
5.3.250.0000.04014.68
5.3.240.0000.03714.61
5.3.230.0100.03314.48
5.3.220.0030.04714.57
5.3.210.0000.04014.45
5.3.200.0030.03314.64
5.3.190.0030.04014.53
5.3.180.0000.04314.58
5.3.170.0070.05014.62
5.3.160.0030.03714.59
5.3.150.0100.05714.63
5.3.140.0100.07014.59
5.3.130.0130.07014.59
5.3.120.0070.04714.69
5.3.110.0030.06714.54
5.3.100.0130.07013.92
5.3.90.0030.04314.03
5.3.80.0130.05313.94
5.3.70.0100.05714.20
5.3.60.0100.07014.00
5.3.50.0130.06714.04
5.3.40.0000.05313.96
5.3.30.0100.05013.86
5.3.20.0070.04713.70
5.3.10.0130.06313.65
5.3.00.0030.06713.56
5.2.170.0030.05711.05
5.2.160.0070.06011.08
5.2.150.0070.06311.23
5.2.140.0070.06011.15
5.2.130.0070.06311.09
5.2.120.0100.05711.08
5.2.110.0070.06311.09
5.2.100.0070.05011.13
5.2.90.0070.06311.08
5.2.80.0100.05711.04
5.2.70.0070.06010.98
5.2.60.0070.06011.05
5.2.50.0000.05310.87
5.2.40.0130.04010.94
5.2.30.0070.02310.94
5.2.20.0000.03311.06
5.2.10.0030.03710.71
5.2.00.0030.03310.71
5.1.60.0070.0279.96
5.1.50.0070.0509.97
5.1.40.0070.04310.07
5.1.30.0030.04010.33
5.1.20.0030.03710.24
5.1.10.0000.05710.09
5.1.00.0000.06310.04
5.0.50.0030.0308.57
5.0.40.0030.0438.46
5.0.30.0030.0678.20
5.0.20.0000.0378.18
5.0.10.0000.0438.17
5.0.00.0000.0338.17
4.4.90.0070.0337.59
4.4.80.0070.0337.59
4.4.70.0000.0277.59
4.4.60.0070.0177.59
4.4.50.0070.0237.59
4.4.40.0070.0537.59
4.4.30.0000.0207.59
4.4.20.0070.0277.59
4.4.10.0000.0307.59
4.4.00.0030.0277.59
4.3.110.0000.0407.59
4.3.100.0100.0277.59
4.3.90.0000.0207.59
4.3.80.0000.0507.59
4.3.70.0000.0207.59
4.3.60.0070.0307.59
4.3.50.0000.0237.59
4.3.40.0030.0477.59
4.3.30.0030.0207.59
4.3.20.0030.0237.59
4.3.10.0000.0377.59
4.3.00.0030.0307.59

preferences:
53.13 ms | 401 KiB | 5 Q