3v4l.org

run code in 300+ PHP versions simultaneously
<?php $exception = ['will not be'=>'will&nbs;pnot&nbs;pbe', 'will not' => 'will&nbs;pnot']; $string = 'They will not begin'; function f($string, $exception){ $newString = strtr($string, $exception); $array = explode(' ', $newString); if( $string !== $newString){ $array = array_combine(array_values($array), array_values($array)); var_dump(array_intersect_key($array, array_flip($exception))); $array = array_replace($array, array_intersect_key($array, array_flip($exception))); } return array_values($array); } var_dump(f($string, $exception)); var_dump(f('Will I love?', $exception)); var_dump(f('I will love.', $exception)); var_dump(f('I will not love.', $exception)); var_dump(f('Do I love?', $exception));

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.40.0120.00318.67
8.3.30.0070.00718.76
8.3.20.0040.00420.34
8.3.10.0090.00021.91
8.3.00.0060.00319.79
8.2.170.0090.00622.96
8.2.160.0080.00819.31
8.2.150.0030.00524.18
8.2.140.0110.00724.66
8.2.130.0080.00026.16
8.2.120.0060.00617.75
8.2.110.0030.00721.18
8.2.100.0040.00717.66
8.2.90.0030.00617.63
8.2.80.0000.00918.61
8.2.70.0090.00017.50
8.2.60.0000.00817.93
8.2.50.0040.00418.07
8.2.40.0060.00321.10
8.2.30.0060.00318.07
8.2.20.0000.00817.62
8.2.10.0050.00318.01
8.2.00.0040.00417.98
8.1.270.0060.00320.25
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0090.00021.98
8.1.230.0080.00420.97
8.1.220.0090.00018.70
8.1.210.0040.00418.77
8.1.200.0030.00517.35
8.1.190.0000.00817.22
8.1.180.0040.00418.10
8.1.170.0040.00418.60
8.1.160.0070.00022.07
8.1.150.0000.00718.75
8.1.140.0100.00017.40
8.1.130.0030.00317.57
8.1.120.0070.00317.46
8.1.110.0000.00717.37
8.1.100.0020.00517.30
8.1.90.0000.00717.44
8.1.80.0050.00217.40
8.1.70.0000.00717.29
8.1.60.0050.00317.52
8.1.50.0050.00517.50
8.1.40.0040.00417.52
8.1.30.0040.00417.60
8.1.20.0040.00417.65
8.1.10.0040.00417.49
8.1.00.0000.00817.46
8.0.300.0000.00819.88
8.0.290.0000.00816.58
8.0.280.0040.00418.34
8.0.270.0060.00317.20
8.0.260.0000.00617.20
8.0.250.0040.00416.79
8.0.240.0030.00316.94
8.0.230.0000.00716.85
8.0.220.0000.00716.80
8.0.210.0030.00316.82
8.0.200.0000.00716.89
8.0.190.0080.00416.88
8.0.180.0030.00316.84
8.0.170.0040.00416.75
8.0.160.0060.00316.73
8.0.150.0030.00316.81
8.0.140.0040.00416.79
8.0.130.0030.00313.23
8.0.120.0040.00416.83
8.0.110.0000.00716.84
8.0.100.0040.00416.88
8.0.90.0000.00816.79
8.0.80.0090.01516.88
8.0.70.0040.00416.77
8.0.60.0040.00416.72
8.0.50.0070.00016.71
8.0.30.0110.00616.94
8.0.20.0070.01317.40
8.0.10.0000.00816.83
8.0.00.0110.01116.74
7.4.330.0060.00015.13
7.4.320.0040.00416.61
7.4.300.0000.00616.61
7.4.290.0020.00516.62
7.4.280.0060.00316.50
7.4.270.0070.00016.50
7.4.260.0040.00416.59
7.4.250.0050.00216.38
7.4.240.0000.00716.50
7.4.230.0000.00716.62
7.4.220.0050.01416.55
7.4.210.0110.00816.55
7.4.200.0040.00416.63
7.4.150.0100.01017.40
7.4.140.0130.01217.86
7.4.130.0150.00516.58
7.4.120.0130.00716.56
7.4.110.0060.01216.36
7.4.100.0080.01216.35
7.4.90.0040.01316.54
7.4.80.0160.00519.39
7.4.70.0130.00616.36
7.4.60.0060.00916.50
7.4.50.0000.00816.46
7.4.40.0090.00916.61
7.4.30.0140.01116.27
7.4.00.0090.00615.03
7.3.330.0050.00013.13
7.3.320.0030.00313.13
7.3.310.0040.00416.37
7.3.300.0020.00516.30
7.3.290.0030.00516.27
7.3.280.0080.00916.31
7.3.270.0120.00617.40
7.3.260.0210.00016.33
7.3.250.0090.00916.35
7.3.240.0100.00816.54
7.3.230.0170.00716.48
7.3.210.0130.00616.47
7.3.200.0150.00619.39
7.3.190.0110.00716.36
7.3.180.0030.01316.32
7.3.170.0120.00616.71
7.3.160.0120.00616.33
7.3.10.0110.00716.20
7.3.00.0120.00316.18
7.2.330.0120.01116.82
7.2.320.0060.01216.62
7.2.310.0120.00616.39
7.2.300.0110.00616.75
7.2.290.0070.01016.46
7.2.130.0000.01816.31
7.2.120.0080.01116.61
7.2.110.0030.01016.63
7.2.100.0070.00315.98
7.2.90.0090.00916.45
7.2.80.0040.01116.62
7.2.70.0040.01116.21
7.2.60.0090.00616.80
7.2.50.0190.00616.87
7.2.40.0120.00616.84
7.2.30.0110.00516.68
7.2.20.0090.00616.46
7.2.10.0030.01016.45
7.2.00.0040.00918.11
7.1.250.0130.00615.44
7.1.100.0000.01517.80
7.1.70.0070.00017.19
7.1.60.0070.01720.03
7.1.50.0000.02016.93
7.1.00.0070.07722.46
7.0.200.0000.01016.67
7.0.110.0070.07719.93
7.0.100.0000.05019.93
7.0.90.0130.07720.04
7.0.80.0100.07719.81
7.0.70.0170.07719.82
7.0.60.0130.06020.04
7.0.50.0070.06719.77
7.0.40.0100.04319.69
7.0.30.0070.07719.68
7.0.20.0170.07719.81
7.0.10.0000.06019.66
7.0.00.0100.08019.79
5.6.280.0070.07021.19
5.6.260.0130.03720.66
5.6.250.0070.07020.58
5.6.240.0030.04720.54
5.6.230.0100.08020.84
5.6.220.0170.05720.61
5.6.210.0100.07720.61
5.6.200.0070.04720.52
5.6.190.0170.07720.84
5.6.180.0130.05020.58
5.6.170.0130.07320.59
5.6.160.0100.08020.61
5.6.150.0100.04320.65
5.6.140.0030.06320.68
5.6.130.0070.08320.68
5.6.120.0030.09020.68
5.6.110.0100.08020.58
5.6.100.0200.05720.68
5.6.90.0070.03320.50
5.6.80.0070.07319.92
5.6.70.0200.06319.96
5.6.60.0130.07319.93
5.6.50.0100.07719.93
5.6.40.0100.04019.92
5.6.30.0030.08019.87
5.6.20.0000.04019.96
5.6.10.0030.06020.02
5.6.00.0000.03720.00
5.5.380.0070.07317.66
5.5.370.0100.07717.75
5.5.360.0030.05017.62
5.5.350.0000.07017.66
5.5.340.0030.04318.15
5.5.330.0000.08717.90
5.5.320.0170.07318.13
5.5.310.0030.06018.29
5.5.300.0070.08318.11
5.5.290.0170.07318.32
5.5.280.0030.08718.18
5.5.270.0100.07018.31
5.5.260.0070.08017.89
5.5.250.0130.07717.84
5.5.240.0070.07717.41
5.5.230.0100.06717.54
5.5.220.0030.07317.37
5.5.210.0070.07717.67
5.5.200.0000.08317.47
5.5.190.0030.07717.35
5.5.180.0070.09017.53
5.5.160.0070.05717.25
5.5.150.0070.03017.51
5.5.140.0070.06317.64
5.5.130.0100.06717.46
5.5.120.0070.06717.48
5.5.110.0000.07717.54
5.5.100.0070.07717.57
5.5.90.0070.03717.36
5.5.80.0130.06717.19
5.5.70.0070.07017.21
5.5.60.0030.07717.24
5.5.50.0170.03717.56
5.5.40.0030.05017.23
5.5.30.0030.07717.23
5.5.20.0070.08017.42
5.5.10.0170.07017.26
5.5.00.0100.08017.23
5.4.450.0100.07719.52
5.4.440.0130.07019.29
5.4.430.0130.04319.49
5.4.420.0200.06319.50
5.4.410.0130.06319.40
5.4.400.0170.06318.97
5.4.390.0070.03719.09
5.4.380.0100.07319.33
5.4.370.0100.07719.25
5.4.360.0030.07718.99
5.4.350.0030.08319.03
5.4.340.0100.08019.16
5.4.320.0070.03719.09
5.4.310.0100.05319.33
5.4.300.0100.06319.09
5.4.290.0070.03019.02
5.4.280.0000.08019.15
5.4.270.0070.07319.00
5.4.260.0030.04319.19
5.4.250.0100.07319.16
5.4.240.0130.03319.34
5.4.230.0000.04719.35
5.4.220.0030.04319.01
5.4.210.0100.07019.24
5.4.200.0070.05019.09
5.4.190.0070.07319.33
5.4.180.0030.07718.95
5.4.170.0070.08019.16
5.4.160.0100.07319.00
5.4.150.0100.07319.01
5.4.140.0030.07716.42
5.4.130.0130.07016.28
5.4.120.0070.07016.33
5.4.110.0100.03716.46
5.4.100.0170.06016.38
5.4.90.0130.06016.38
5.4.80.0070.06716.50
5.4.70.0070.07016.40
5.4.60.0070.07316.47
5.4.50.0100.03316.43
5.4.40.0170.06316.48
5.4.30.0030.07316.47
5.4.20.0030.06316.50
5.4.10.0070.08016.28
5.4.00.0000.07015.98

preferences:
48.83 ms | 400 KiB | 5 Q