3v4l.org

run code in 300+ PHP versions simultaneously
<?php $file_content = "Employees are employees_category MyEmployees kitEMPLOYEESMATCH"; $f = 'employees'; $r = 'vehicles'; $pattern = '~(' . implode( ')|(', [ preg_quote($f, '~'), preg_quote(ucfirst($f), '~'), preg_quote(strtoupper($f), '~') ] ) . ')~'; $lookup = [ 1 => $r, 2 => ucfirst($r), 3 => strtoupper($r) ]; var_export( preg_replace_callback( $pattern, function($m) use ($lookup) { return $lookup[count($m) - 1]; }, $file_content ) );

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.4.120.0120.00723.96
8.4.110.0170.00520.62
8.4.100.0120.00817.75
8.4.90.0080.01120.64
8.4.80.0130.00618.75
8.4.70.0100.00618.25
8.4.60.0120.01120.54
8.4.50.0120.00917.83
8.4.40.0120.00317.84
8.4.30.0040.01520.75
8.4.20.0140.00719.77
8.4.10.0070.01319.73
8.3.250.0090.00918.84
8.3.240.0110.00817.23
8.3.230.0110.00716.77
8.3.220.0030.00518.86
8.3.210.0130.00116.80
8.3.200.0060.00316.78
8.3.190.0110.00817.22
8.3.180.0070.00416.90
8.3.170.0120.00619.16
8.3.160.0120.00618.51
8.3.150.0130.00620.95
8.3.140.0060.01216.72
8.3.130.0050.00317.05
8.3.120.0000.00918.99
8.3.110.0100.01020.94
8.3.100.0160.00017.04
8.3.90.0040.00426.77
8.3.80.0060.00319.36
8.3.70.0090.01218.43
8.3.60.0120.00916.75
8.3.50.0100.00724.58
8.3.40.0100.01022.03
8.3.30.0110.00418.76
8.3.20.0070.00024.18
8.3.10.0060.00324.66
8.3.00.0030.00526.16
8.2.290.0120.00720.43
8.2.280.0060.00320.56
8.2.270.0140.00418.96
8.2.260.0000.01518.87
8.2.250.0160.00016.67
8.2.240.0060.00317.19
8.2.230.0130.00722.58
8.2.220.0160.00333.04
8.2.210.0000.00726.77
8.2.200.0060.00318.88
8.2.190.0120.00616.71
8.2.180.0120.00325.92
8.2.170.0070.00719.13
8.2.160.0140.00022.96
8.2.150.0050.00325.66
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0000.00821.28
8.2.110.0060.00321.31
8.2.100.0080.00418.03
8.2.90.0040.00419.34
8.2.80.0040.00418.16
8.2.70.0000.00817.88
8.2.60.0000.00817.75
8.2.50.0030.00619.73
8.2.40.0090.00017.88
8.2.30.0000.00718.18
8.2.20.0030.00518.04
8.2.10.0040.00419.43
8.2.00.0070.00019.34
8.1.330.0160.00321.72
8.1.320.0130.00616.46
8.1.310.0000.00916.96
8.1.300.0060.00318.30
8.1.290.0090.00030.84
8.1.280.0130.00625.92
8.1.270.0030.00623.99
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0000.00921.10
8.1.230.0060.00618.99
8.1.220.0000.00817.74
8.1.210.0040.00418.77
8.1.200.0050.00317.23
8.1.190.0040.00417.48
8.1.180.0040.00418.10
8.1.170.0000.00920.57
8.1.160.0000.00818.98
8.1.150.0040.00418.97
8.1.140.0040.00418.77
8.1.130.0000.00919.34
8.1.120.0000.00717.58
8.1.110.0000.00817.53
8.1.100.0040.00417.63
8.1.90.0040.00417.59
8.1.80.0040.00417.68
8.1.70.0050.00317.46
8.1.60.0090.00017.76
8.1.50.0030.00617.68
8.1.40.0000.00817.67
8.1.30.0050.00317.89
8.1.20.0040.00417.86
8.1.10.0080.00417.74
8.1.00.0050.00317.70
8.0.300.0040.00418.77
8.0.290.0040.00416.88
8.0.280.0050.00218.47
8.0.270.0030.00318.15
8.0.260.0000.00716.85
8.0.250.0000.00717.14
8.0.240.0030.00317.03
8.0.230.0030.00317.17
8.0.220.0000.00817.13
8.0.210.0040.00417.07
8.0.200.0070.00016.99
8.0.190.0000.00917.04
8.0.180.0080.00016.98
8.0.170.0030.00617.06
8.0.160.0040.00416.92
8.0.150.0030.00517.07
8.0.140.0040.00416.93
8.0.130.0050.00013.54
8.0.120.0040.00416.84
8.0.110.0000.00816.95
8.0.100.0030.00617.09
8.0.90.0070.00016.92
8.0.80.0120.00717.09
8.0.70.0050.00316.84
8.0.60.0020.00516.98
8.0.50.0020.00516.92
8.0.30.0080.00817.03
8.0.20.0030.01417.15
8.0.10.0030.00517.21
8.0.00.0060.01317.23
7.4.330.0000.00515.55
7.4.320.0000.00616.83
7.4.300.0060.00016.64
7.4.290.0000.00716.69
7.4.280.0050.00316.86
7.4.270.0000.00716.62
7.4.260.0040.00416.61
7.4.250.0000.00816.61
7.4.240.0060.00316.82
7.4.230.0070.00016.89
7.4.220.0070.00016.78
7.4.210.0070.01016.83
7.4.200.0040.00416.89
7.4.130.0100.01016.60
7.4.120.0070.01016.70
7.4.110.0070.01516.61
7.4.100.0130.01016.70
7.4.90.0040.01616.71
7.4.80.0060.01616.89
7.4.70.0090.01516.75
7.4.60.0120.00616.61
7.4.50.0110.00816.61
7.4.40.0100.00916.80
7.4.30.0150.00916.81
7.4.20.0150.00616.66
7.4.10.0150.00616.78
7.4.00.0100.01316.68
7.3.330.0070.00016.54
7.3.320.0050.00013.47
7.3.310.0030.00316.39
7.3.300.0000.00616.39
7.3.290.0090.00716.50
7.3.260.0070.01016.58
7.3.250.0070.01016.48
7.3.240.0130.00716.47
7.3.230.0150.01216.45
7.3.220.0120.01116.49
7.3.210.0100.01016.73
7.3.200.0130.01016.41
7.3.190.0090.01016.65
7.3.180.0080.01116.56
7.3.170.0100.01716.48
7.3.160.0170.00716.38
7.3.150.0140.01016.52
7.3.140.0200.00716.81
7.3.130.0060.01416.74
7.3.120.0200.00316.57
7.3.110.0190.00616.38
7.3.100.0190.00316.82
7.3.90.0030.01716.64
7.3.80.0140.01116.52
7.3.70.0100.01416.79
7.3.60.0080.01216.53
7.3.50.0110.00916.67
7.3.40.0000.01916.64
7.3.30.0110.01416.59
7.3.20.0100.01016.57
7.3.10.0090.01216.52
7.3.00.0160.00616.61

preferences:
28.53 ms | 403 KiB | 5 Q