3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str1 = "Samsung Television 21 Television new"; $syns = [ 'tv' => ['sdds', 'Television new', 'Television11'] ]; $str1 = array_reduce(array_keys($syns), function($c, $x) use ($syns) { return $c = preg_replace('/\b'.join('\b|\b', $syns[$x]).'\b/', $x, $c); }, $str1); $arr1 = explode(' ', $str1); var_dump($arr1); ?>

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.1.60.0040.00417.80
8.1.50.0040.00417.62
8.1.40.0030.00617.59
8.1.30.0030.00617.79
8.1.20.0040.00417.82
8.1.10.0000.00717.82
8.1.00.0000.00917.57
8.0.190.0070.00017.02
8.0.180.0000.00716.98
8.0.170.0040.00416.98
8.0.160.0040.00416.97
8.0.150.0040.00416.92
8.0.140.0000.00816.91
8.0.130.0000.00513.48
8.0.120.0030.00616.96
8.0.110.0070.00017.04
8.0.100.0040.00417.12
8.0.90.0040.00417.18
8.0.80.0090.00917.05
8.0.70.0000.00817.02
8.0.60.0000.00717.00
8.0.50.0050.00317.10
8.0.30.0190.00317.12
8.0.20.0090.01017.50
8.0.10.0050.00217.17
8.0.00.0100.00816.88
7.4.290.0000.00716.59
7.4.280.0000.00716.86
7.4.270.0070.00016.82
7.4.260.0030.00316.86
7.4.250.0030.00516.80
7.4.240.0030.00516.72
7.4.230.0070.00016.95
7.4.220.0090.00916.76
7.4.210.0070.00816.73
7.4.200.0000.00716.54
7.4.190.0080.00016.97
7.4.160.0130.00316.80
7.4.150.0060.01217.40
7.4.140.0120.00617.86
7.4.130.0100.00816.85
7.4.120.0050.01316.77
7.4.110.0030.01416.79
7.4.100.0100.00716.61
7.4.90.0090.00916.85
7.4.80.0170.00019.39
7.4.70.0130.00716.79
7.4.60.0130.00616.76
7.4.50.0020.00216.69
7.4.40.0060.00622.77
7.4.30.0140.00316.59
7.4.00.0000.01515.22
7.3.330.0030.00313.46
7.3.320.0030.00313.22
7.3.310.0000.00716.36
7.3.300.0000.00716.44
7.3.290.0090.00516.60
7.3.280.0070.01116.46
7.3.270.0130.00417.40
7.3.260.0150.01216.56
7.3.250.0080.01016.69
7.3.240.0080.00916.48
7.3.230.0150.00716.58
7.3.210.0100.01016.54
7.3.200.0120.00619.39
7.3.190.0120.01216.79
7.3.180.0110.00516.64
7.3.170.0130.01016.48
7.3.160.0090.00616.72
7.3.120.0120.00615.11
7.2.330.0070.01016.88
7.2.320.0100.00716.56
7.2.310.0090.00916.66
7.2.300.0130.00316.90
7.2.290.0110.00616.86
7.2.60.0060.00617.20
7.1.200.0000.01515.79
7.1.70.0110.00017.07
7.1.60.0030.02119.82
7.1.50.0090.00917.13
7.1.00.0030.07722.36
7.0.200.0040.00416.86
7.0.140.0070.07022.04
7.0.60.0030.08319.84
7.0.50.0070.08317.85
7.0.40.0170.08020.08
7.0.30.0500.07020.21
7.0.20.0230.06020.12
7.0.10.0370.07320.18
7.0.00.0070.09320.11
5.6.280.0100.06720.91
5.6.210.0170.05020.69
5.6.200.0070.08318.13
5.6.190.0100.08320.65
5.6.180.0400.07320.38
5.6.170.0330.03320.50
5.6.160.0200.07320.55
5.6.150.0070.05718.28
5.6.140.0030.04318.20
5.6.130.0000.06018.11
5.6.120.0100.08321.02
5.6.110.0100.06321.00
5.6.100.0100.08021.09
5.6.90.0170.07321.14
5.6.80.0100.04720.38
5.6.70.3970.03320.58
5.5.350.0230.02720.45
5.5.340.0070.08317.94
5.5.330.0030.05020.33
5.5.320.0300.04320.27
5.5.310.0130.06020.19
5.5.300.0170.07017.98
5.5.290.0070.07017.98
5.5.280.0130.08020.88
5.5.270.0030.06020.89
5.5.260.0030.08720.98
5.5.250.0130.06320.59
5.5.240.0100.06720.37
5.4.450.0300.03719.18
5.4.440.0230.08019.52
5.4.430.0170.04719.32
5.4.420.0100.06019.41
5.4.410.0400.05319.34
5.4.400.0330.05719.18
5.4.390.0270.03019.15
5.4.380.0130.04018.96
5.4.370.0200.03319.09
5.4.360.0230.05019.09
5.4.350.0200.06719.14
5.4.340.0130.04319.11
5.4.320.0300.06719.13
5.4.310.0130.04019.22
5.4.300.0270.03319.24
5.4.290.0170.04719.09
5.4.280.0300.08019.00
5.4.270.0330.06319.24
5.4.260.0230.06319.30
5.4.250.0300.06018.83
5.4.240.0200.04319.08
5.4.230.0200.04319.00
5.4.220.0200.04719.08
5.4.210.0200.04018.99
5.4.200.0270.06719.21
5.4.190.0230.03319.05
5.4.180.0200.03719.15
5.4.170.0230.03718.99
5.4.160.0170.04719.19
5.4.150.0230.05019.17
5.4.140.0300.03716.39
5.4.130.0230.06316.49
5.4.120.0170.04016.53
5.4.110.0170.04316.59
5.4.100.0230.03316.51
5.4.90.0170.03716.56
5.4.80.0170.03716.43
5.4.70.0170.03716.57
5.4.60.0170.03716.35
5.4.50.0170.03316.43
5.4.40.0130.03716.45
5.4.30.0170.05316.42
5.4.20.0170.03316.52
5.4.10.0230.06016.43
5.4.00.0170.03715.94
5.3.290.0170.04714.51
5.3.280.0300.04314.58
5.3.270.0170.03714.45
5.3.260.0130.05014.46
5.3.250.0270.05014.45
5.3.240.0170.04714.46
5.3.230.0230.04014.45
5.3.220.0200.03314.40
5.3.210.0100.04314.41
5.3.200.0200.03314.42
5.3.190.0200.04014.43
5.3.180.0200.03714.55
5.3.170.0230.03714.52
5.3.160.0100.04314.47
5.3.150.0130.05014.44
5.3.140.0200.03714.39
5.3.130.0130.04014.42
5.3.120.0170.04014.38
5.3.110.0200.03314.41
5.3.100.0200.03314.05
5.3.90.0170.03713.88
5.3.80.0170.04313.97
5.3.70.0200.03313.89
5.3.60.0200.03313.91
5.3.50.0170.04313.91
5.3.40.0100.04313.71
5.3.30.0370.04013.85
5.3.20.0130.04013.52
5.3.10.0130.04713.52
5.3.00.0170.03313.43
5.2.170.0100.03311.30
5.2.160.0170.02311.05
5.2.150.0070.03711.08
5.2.140.0130.03311.16
5.2.130.0170.02310.96
5.2.120.0070.04011.01
5.2.110.0100.03311.12
5.2.100.0130.03010.95
5.2.90.0100.03010.96
5.2.80.0130.03010.93
5.2.70.0130.03011.04
5.2.60.0170.03010.89
5.2.50.0100.05311.04
5.2.40.0100.03711.01
5.2.30.0170.03010.81
5.2.20.0070.03310.81
5.2.10.0130.02710.80
5.2.00.0030.03710.63
5.1.60.0130.02310.08
5.1.50.0170.01710.09
5.1.40.0130.0309.88
5.1.30.0130.03010.25
5.1.20.0130.02310.25
5.1.10.0100.0309.96
5.1.00.0130.0309.96
5.0.50.0070.0278.52
5.0.40.0100.0378.38
5.0.30.0130.0478.16
5.0.20.0030.0238.13
5.0.10.0070.0238.14
5.0.00.0070.0308.08
4.4.90.0070.0407.97
4.4.80.0070.0177.97
4.4.70.0070.0277.97
4.4.60.0070.0377.97
4.4.50.0030.0237.97
4.4.40.0030.0477.97
4.4.30.0070.0377.97
4.4.20.0070.0337.97
4.4.10.0100.0137.97
4.4.00.0100.0237.97
4.3.110.0030.0177.97
4.3.100.0070.0207.97
4.3.90.0070.0177.97
4.3.80.0130.0437.97
4.3.70.0100.0277.97
4.3.60.0070.0177.97
4.3.50.0130.0307.97
4.3.40.0000.0407.97
4.3.30.0000.0207.97
4.3.20.0030.0207.97
4.3.10.0000.0307.97
4.3.00.0070.0277.97

preferences:
13.87 ms | 406 KiB | 5 Q