3v4l.org

run code in 300+ PHP versions simultaneously
<?php $exception = ['will not be '=>'will__not__be ', 'will not ' => 'will__not ']; function f($string, $exception){ $newString = strtr($string, $exception); dump($newString); $array = explode(' ', $newString); if( $string !== $newString){ $array = array_combine($array, $array); $flip = array_map('trim', array_flip(array_map('trim', $exception))); $array = array_replace($array, array_intersect_key($flip, $array)); } return array_values($array); } var_dump(f('They will not begin', $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.60.0150.00318.41
8.3.50.0140.00721.09
8.3.40.0110.00418.88
8.3.30.0070.01118.84
8.3.20.0000.00920.35
8.3.10.0050.00321.73
8.3.00.0100.00019.69
8.2.180.0100.01318.29
8.2.170.0040.01122.96
8.2.160.0030.01020.52
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0090.00026.16
8.2.120.0130.00317.36
8.2.110.0030.00622.05
8.2.100.0080.00417.50
8.2.90.0080.00019.22
8.2.80.0040.00417.97
8.2.70.0030.00617.63
8.2.60.0040.00417.55
8.2.50.0090.00418.07
8.2.40.0040.00421.00
8.2.30.0040.00717.93
8.2.20.0040.00417.71
8.2.10.0040.00418.09
8.2.00.0040.00418.04
8.1.280.0160.00325.92
8.1.270.0040.00420.32
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0060.00320.95
8.1.230.0040.00817.42
8.1.220.0000.00817.79
8.1.210.0040.00418.77
8.1.200.0120.00017.22
8.1.190.0000.00817.23
8.1.180.0040.00418.10
8.1.170.0040.00418.49
8.1.160.0000.00822.22
8.1.150.0070.00018.75
8.1.140.0030.00617.33
8.1.130.0030.00317.75
8.1.120.0000.01117.50
8.1.110.0020.00517.36
8.1.100.0040.00417.48
8.1.90.0040.00417.44
8.1.80.0000.00717.32
8.1.70.0030.00317.45
8.1.60.0040.00417.61
8.1.50.0030.00617.61
8.1.40.0000.00817.54
8.1.30.0000.00817.69
8.1.20.0000.00717.69
8.1.10.0030.00517.52
8.1.00.0040.00417.57
8.0.300.0000.00818.77
8.0.290.0040.00416.62
8.0.280.0000.00718.31
8.0.270.0000.00717.23
8.0.260.0060.00017.23
8.0.250.0040.00417.01
8.0.240.0030.00316.95
8.0.230.0040.00416.89
8.0.220.0030.00316.77
8.0.210.0000.00817.00
8.0.200.0030.00317.01
8.0.190.0000.00716.98
8.0.180.0000.00816.98
8.0.170.0040.00416.75
8.0.160.0000.00816.96
8.0.150.0070.00016.98
8.0.140.0060.00316.88
8.0.130.0030.00313.40
8.0.120.0040.00416.91
8.0.110.0070.00016.95
8.0.100.0040.00416.77
8.0.90.0000.00816.84
8.0.80.0100.00616.85
8.0.70.0050.00216.92
8.0.60.0050.00316.81
8.0.50.0070.00017.03
8.0.30.0140.00417.20
8.0.20.0110.01117.40
8.0.10.0040.00416.91
8.0.00.0120.00916.91
7.4.330.0020.00215.09
7.4.320.0060.00016.60
7.4.300.0000.00616.54
7.4.290.0000.00616.68
7.4.280.0040.00416.65
7.4.270.0000.00716.54
7.4.260.0030.00316.52
7.4.250.0000.00716.45
7.4.240.0000.00716.53
7.4.230.0050.00316.73
7.4.220.0180.00016.66
7.4.210.0040.01016.56
7.4.200.0030.00316.44
7.4.160.0040.01216.60
7.4.150.0000.01817.40
7.4.140.0080.01517.86
7.4.130.0100.00916.63
7.4.120.0130.00616.52
7.4.110.0100.00716.38
7.4.100.0150.00316.45
7.4.90.0040.01916.63
7.4.80.0040.02119.39
7.4.70.0140.00416.42
7.4.60.0100.00916.43
7.4.50.0050.00216.63
7.4.40.0080.00816.56
7.4.30.0070.01416.59
7.4.00.0070.01015.20
7.3.330.0000.00513.30
7.3.320.0060.00013.41
7.3.310.0000.00716.37
7.3.300.0070.00016.25
7.3.290.0040.01416.29
7.3.280.0100.00916.33
7.3.270.0030.01417.40
7.3.260.0090.00916.56
7.3.250.0130.00616.42
7.3.240.0140.00316.50
7.3.230.0060.01516.52
7.3.210.0040.01316.57
7.3.200.0130.00319.39
7.3.190.0090.01216.16
7.3.180.0080.00816.35
7.3.170.0120.01016.42
7.3.160.0090.01016.43
7.3.10.0070.00716.73
7.3.00.0100.00616.78
7.2.330.0120.00616.75
7.2.320.0090.00916.66
7.2.310.0090.01216.69
7.2.300.0030.01416.52
7.2.290.0090.00916.32
7.2.130.0060.00616.89
7.2.120.0060.00616.83
7.2.110.0110.00416.54
7.2.100.0040.01116.89
7.2.90.0030.01316.91
7.2.80.0120.00316.81
7.2.70.0040.01216.80
7.2.60.0130.00816.85
7.2.50.0000.01016.66
7.2.40.0070.00717.00
7.2.30.0050.00316.98
7.2.20.0060.00616.88
7.2.10.0070.00316.88
7.2.00.0030.00818.05
7.1.250.0030.00915.74
7.1.200.0210.00415.82
7.1.100.0000.01018.20
7.1.70.0040.00417.15
7.1.60.0040.01920.03
7.1.50.0070.01416.63
7.1.00.0030.07722.48
7.0.200.0070.00716.69
7.0.60.0000.08720.02
7.0.50.0100.07317.87
7.0.40.0170.08020.10
7.0.30.0170.04320.08
7.0.20.0300.08020.33
7.0.10.0170.06720.07
7.0.00.0070.08720.10
5.6.280.0070.06720.90
5.6.210.0100.06020.50
5.6.200.0100.08318.25
5.6.190.0170.07720.55
5.6.180.0030.04020.47
5.6.170.0330.07720.54
5.6.160.0130.03720.44
5.6.150.0000.04318.19
5.6.140.0070.08318.18
5.6.130.0030.06318.18
5.6.120.0030.05021.00
5.6.110.0130.06020.98
5.6.100.0000.05021.12
5.6.90.0100.08020.88
5.6.80.0100.07320.49
5.6.70.0070.08320.36
5.5.350.0000.05020.50
5.5.340.0170.06317.96
5.5.330.0100.07320.37
5.5.320.0400.07320.25
5.5.310.0370.07320.23
5.5.300.0070.06318.01
5.5.290.0070.08317.95
5.5.280.0100.08020.78
5.5.270.0100.08320.66
5.5.260.0170.07720.83
5.5.250.0200.06020.46
5.5.240.0070.08020.27
5.4.450.0600.05319.45
5.4.440.0730.06319.68
5.4.430.0500.06719.69
5.4.420.0600.05719.41
5.4.410.0630.05019.21
5.4.400.0700.05319.31
5.4.390.0470.06019.15
5.4.380.0700.05719.14
5.4.370.0630.05319.23
5.4.360.0800.04019.14
5.4.350.0370.05719.14
5.4.340.0170.05019.14
5.4.320.0030.06319.14
5.4.310.0300.05319.14
5.4.300.0500.05318.84
5.4.290.0130.05718.80
5.4.280.0100.05319.22
5.4.270.0330.05019.16
5.4.260.0630.04019.14
5.4.250.0400.05319.21
5.4.240.0030.05719.24
5.4.230.0230.04718.83
5.4.220.0530.06319.25
5.4.210.0470.05719.15
5.4.200.0570.04716.89
5.4.190.0570.05719.05
5.4.180.0500.05019.08
5.4.170.0670.06018.99
5.4.160.0600.06019.07
5.4.150.0600.05719.22
5.4.140.0600.05316.48
5.4.130.0600.05316.48
5.4.120.0530.04716.45
5.4.110.0570.05316.54
5.4.100.0700.05316.32
5.4.90.0700.05716.38
5.4.80.0800.05016.42
5.4.70.0600.05016.48
5.4.60.0570.04016.35
5.4.50.0530.05016.52
5.4.40.0630.06016.37
5.4.30.0630.06016.26
5.4.20.0570.08316.26
5.4.10.0670.06716.27
5.4.00.0530.06715.77

preferences:
75.43 ms | 401 KiB | 5 Q