3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "Red Cell is very good. Condition is new. But nobody buys it."; $words = ["Red Cell", "Condition", "no", "Red", "new"]; $translations = ["Red Cell", "Stav", "ne", "Červený", "nový"]; $pairs = array_combine($words, $translations); krsort($pairs); $pattern = '~\b(?:' . implode('|', array_keys($pairs)) . ')\b~u'; $result = preg_replace_callback($pattern, function ($m) use ($pairs) { return $pairs[$m[0]]; }, $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.5.00.0160.00920.40
8.4.150.0030.00014.05
8.4.140.0120.00917.86
8.4.130.0110.01018.77
8.4.120.0120.00824.17
8.4.110.0130.00820.95
8.4.100.0170.00118.94
8.4.90.0050.00322.43
8.4.80.0080.00718.98
8.4.70.0110.00818.70
8.4.60.0060.00718.99
8.4.50.0050.00520.54
8.4.40.0130.00620.72
8.4.30.0080.00824.17
8.4.20.0100.01019.08
8.4.10.0080.00818.12
8.3.280.0140.00718.68
8.3.270.0110.00716.63
8.3.260.0080.00116.84
8.3.250.0130.00819.05
8.3.240.0100.00517.25
8.3.230.0120.00616.69
8.3.220.0100.00819.05
8.3.210.0110.00718.71
8.3.200.0050.00416.75
8.3.190.0100.00917.21
8.3.180.0100.00816.96
8.3.170.0090.00617.18
8.3.160.0040.01520.38
8.3.150.0130.00617.09
8.3.140.0030.00518.58
8.3.130.0040.00418.56
8.3.120.0040.00420.72
8.3.110.0000.00918.70
8.3.100.0060.00316.73
8.3.90.0140.00418.59
8.3.80.0030.00618.55
8.3.70.0110.00418.56
8.3.60.0130.00718.56
8.3.50.0100.01216.79
8.3.40.0110.00418.92
8.3.30.0090.00619.01
8.3.20.0070.00021.81
8.3.10.0070.00420.21
8.3.00.0000.00823.50
8.2.290.0040.00620.82
8.2.280.0080.00518.44
8.2.270.0100.00717.19
8.2.260.0080.00016.97
8.2.250.0030.00618.84
8.2.240.0060.00617.13
8.2.230.0110.00020.94
8.2.220.0000.01024.06
8.2.210.0030.00526.77
8.2.200.0080.00018.54
8.2.190.0130.01016.75
8.2.180.0150.00017.00
8.2.170.0090.00622.96
8.2.160.0040.01121.31
8.2.150.0000.00725.66
8.2.140.0060.00324.66
8.2.130.0080.00026.16
8.2.120.0040.00426.16
8.2.110.0060.00322.25
8.2.100.0080.00418.28
8.2.90.0040.00419.38
8.2.80.0080.00017.97
8.2.70.0060.00317.75
8.2.60.0030.00617.93
8.2.50.0040.00418.07
8.2.40.0000.00818.35
8.2.30.0070.00018.24
8.2.20.0000.00818.10
8.2.10.0000.00821.18
8.2.00.0000.00819.35
8.1.330.0130.00321.86
8.1.320.0100.01016.53
8.1.310.0040.00418.28
8.1.300.0060.01316.67
8.1.290.0000.00918.88
8.1.280.0090.00625.92
8.1.270.0030.00622.14
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0030.00623.97
8.1.230.0100.00022.27
8.1.220.0040.00417.88
8.1.210.0040.00418.77
8.1.200.0060.00317.48
8.1.190.0050.00317.48
8.1.180.0080.00018.10
8.1.170.0050.00318.79
8.1.160.0000.00818.91
8.1.150.0000.00719.04
8.1.140.0030.00520.82
8.1.130.0030.00317.72
8.1.120.0040.00417.52
8.1.110.0040.00417.50
8.1.100.0070.00017.51
8.1.90.0050.00217.63
8.1.80.0050.00217.64
8.1.70.0060.00317.59
8.1.60.0120.00117.65
8.1.50.0130.00317.64
8.1.40.0110.00317.59
8.1.30.0050.00517.75
8.1.20.0060.00417.71
8.1.10.0120.00217.65
8.1.00.0040.00917.64
8.0.300.0040.00418.96
8.0.290.0030.00616.88
8.0.280.0000.00718.48
8.0.270.0040.00417.28
8.0.260.0070.00316.88
8.0.250.0000.00717.16
8.0.240.0040.00417.16
8.0.230.0070.00017.20
8.0.220.0030.00317.04
8.0.210.0070.00017.07
8.0.200.0020.00517.03
8.0.190.0060.00417.13
8.0.180.0070.00317.14
8.0.170.0040.00617.03
8.0.160.0030.00717.05
8.0.150.0060.00516.99
8.0.140.0080.00317.07
8.0.130.0070.00415.31
8.0.120.0100.00217.13
8.0.110.0040.00717.16
8.0.100.0100.00117.06
8.0.90.0070.00517.11
8.0.80.0100.00717.14
8.0.70.0090.00317.02
8.0.60.0080.00517.15
8.0.50.0080.00317.17
8.0.30.0100.00717.20
8.0.20.0100.00817.23
8.0.10.0080.00417.15
8.0.00.0100.00717.07
7.4.330.0000.00515.55
7.4.320.0030.00316.78
7.4.300.0030.00416.74
7.4.290.0060.00616.76
7.4.280.0090.00416.79
7.4.270.0090.00516.75
7.4.260.0070.00616.90
7.4.250.0080.00416.80
7.4.240.0060.00416.76
7.4.230.0070.00616.87
7.4.220.0060.00616.73
7.4.210.0090.00816.88
7.4.200.0040.00816.82
7.4.190.0050.01016.83
7.4.180.0090.00416.79
7.4.160.0070.00716.75
7.4.150.0090.00516.65
7.4.140.0070.01117.21
7.4.130.0110.00616.78
7.4.120.0110.00716.64
7.4.110.0090.01016.79
7.4.100.0100.00916.73
7.4.90.0150.00416.73
7.4.80.0100.00917.52
7.4.70.0110.00716.61
7.4.60.0110.00616.61
7.4.50.0100.00716.55
7.4.40.0090.00816.70
7.4.30.0120.00516.65
7.4.20.0110.00616.53
7.4.10.0130.00416.58
7.4.00.0110.00516.31
7.3.330.0020.00614.98
7.3.320.0070.00414.94
7.3.310.0050.00616.51
7.3.300.0060.00516.65
7.3.290.0140.00216.49
7.3.280.0090.00616.49
7.3.270.0070.00716.61
7.3.260.0130.00816.63
7.3.250.0120.00416.54
7.3.240.0110.00716.70
7.3.230.0060.01116.57
7.3.220.0120.00416.46
7.3.210.0090.00816.49
7.3.200.0050.01116.64
7.3.190.0100.00816.57
7.3.180.0070.01116.63
7.3.170.0100.00816.62
7.3.160.0070.01116.57
7.3.150.0110.00616.46
7.3.140.0130.00416.44
7.3.130.0070.01116.53
7.3.120.0090.00816.35
7.3.110.0120.00516.52
7.3.100.0050.01116.47
7.3.90.0070.01016.61
7.3.80.0050.01216.58
7.3.70.0130.00416.10
7.3.60.0100.00916.12
7.3.50.0070.01016.10
7.3.40.0080.00716.07
7.3.30.0110.00516.01
7.3.20.0120.00416.72
7.3.10.0120.00416.68
7.3.00.0420.00816.55
7.2.340.0080.00516.46
7.2.330.0130.00416.74
7.2.320.0120.00716.74
7.2.310.0110.00916.81
7.2.300.0100.00916.79
7.2.290.0110.00616.71
7.2.280.0120.00516.78
7.2.270.0120.00616.76
7.2.260.0090.00816.56
7.2.250.0110.00716.52
7.2.240.0170.00016.62
7.2.230.0110.00616.62
7.2.220.0130.00616.65
7.2.210.0110.00716.63
7.2.200.0080.00916.28
7.2.190.0150.00416.17
7.2.180.0080.00916.36
7.2.170.0100.00416.25
7.2.160.0100.00516.21
7.2.150.0100.00816.88
7.2.140.0130.00816.99
7.2.130.0110.00616.95
7.2.120.0150.00916.97
7.2.110.0140.00616.83
7.2.100.0120.01116.94
7.2.90.0130.00817.01
7.2.80.0320.00616.91
7.2.70.0110.00716.86
7.2.60.0100.00917.01
7.2.50.0120.00617.00
7.2.40.0110.01016.89
7.2.30.0110.01116.95
7.2.20.0130.01116.88
7.2.10.0110.01116.90
7.2.00.0100.01016.90
7.1.330.0160.00516.60
7.1.320.0180.00416.83
7.1.310.0140.00816.57
7.1.300.0130.00715.63
7.1.290.0140.00715.79
7.1.280.0160.00715.75
7.1.270.0140.00515.79
7.1.260.0170.00515.74
7.1.250.0220.00315.66
7.1.240.0150.00716.55
7.1.230.0200.00616.56
7.1.220.0130.01116.49
7.1.210.0160.00716.50
7.1.200.0150.00816.54
7.1.190.0170.00516.64
7.1.180.0140.00816.64
7.1.170.0160.00616.48
7.1.160.0130.00916.54
7.1.150.0260.00416.55
7.1.140.0150.00716.52
7.1.130.0140.01016.52
7.1.120.0160.00616.51
7.1.110.0150.00716.65
7.1.100.0180.00416.60
7.1.90.0140.00716.72
7.1.80.0180.00416.63
7.1.70.0160.00716.46
7.1.60.0170.00416.69
7.1.50.0130.00916.51
7.1.40.0140.00816.73
7.1.30.0150.00916.80
7.1.20.0130.00816.58
7.1.10.0180.00416.75
7.1.00.0100.00216.59

preferences:
189.34 ms | 403 KiB | 5 Q