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, fn($m) => $lookup[array_key_last($m)], $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.0080.01124.05
8.4.110.0040.00520.52
8.4.100.0130.00718.15
8.4.90.0130.00818.44
8.4.80.0130.00817.98
8.4.70.0110.00418.18
8.4.60.0080.00819.10
8.4.50.0080.01218.76
8.4.40.0040.01118.07
8.4.30.0160.00320.89
8.4.20.0130.00719.63
8.4.10.0090.00019.41
8.3.250.0130.00518.97
8.3.240.0100.00817.36
8.3.230.0090.00716.86
8.3.220.0130.00517.29
8.3.210.0100.01016.76
8.3.200.0050.00416.85
8.3.190.0100.00816.66
8.3.180.0070.00117.26
8.3.170.0070.01118.75
8.3.160.0100.01020.32
8.3.150.0060.00317.26
8.3.140.0090.00917.26
8.3.130.0060.00316.84
8.3.120.0030.00620.78
8.3.110.0040.00416.66
8.3.100.0060.00318.73
8.3.90.0080.00026.77
8.3.80.0060.00316.71
8.3.70.0160.01016.75
8.3.60.0110.00416.75
8.3.50.0140.00524.57
8.3.40.0070.00722.09
8.3.30.0060.00918.98
8.3.20.0040.00424.18
8.3.10.0080.00024.66
8.3.00.0030.00526.16
8.2.290.0120.00620.71
8.2.280.0050.00318.57
8.2.270.0090.00617.27
8.2.260.0050.00517.00
8.2.250.0040.01516.78
8.2.240.0090.00016.93
8.2.230.0060.00320.94
8.2.220.0060.00324.06
8.2.210.0110.00726.77
8.2.200.0030.00618.79
8.2.190.0070.00718.79
8.2.180.0120.00325.92
8.2.170.0090.00619.16
8.2.160.0000.01422.96
8.2.150.0040.00425.66
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00426.35
8.2.110.0000.01121.25
8.2.100.0090.00317.85
8.2.90.0040.00418.03
8.2.80.0030.00617.97
8.2.70.0030.00517.88
8.2.60.0040.00417.93
8.2.50.0040.00818.07
8.2.40.0000.00718.34
8.2.30.0020.00518.25
8.2.20.0000.00818.21
8.2.10.0040.00419.34
8.2.00.0050.00219.25
8.1.330.0070.00321.91
8.1.320.0120.00716.30
8.1.310.0070.01018.40
8.1.300.0000.00816.61
8.1.290.0030.00630.84
8.1.280.0090.00925.92
8.1.270.0050.00322.23
8.1.260.0070.00028.09
8.1.250.0120.00628.09
8.1.240.0030.00622.19
8.1.230.0000.01220.84
8.1.220.0030.00517.74
8.1.210.0050.00318.81
8.1.200.0060.00317.48
8.1.190.0040.00417.48
8.1.180.0040.00419.14
8.1.170.0030.00518.68
8.1.160.0000.00818.92
8.1.150.0040.00418.88
8.1.140.0050.00318.80
8.1.130.0050.00320.22
8.1.120.0040.00317.60
8.1.110.0030.00617.62
8.1.100.0040.00417.63
8.1.90.0030.00517.57
8.1.80.0030.00617.57
8.1.70.0030.00517.63
8.1.60.0070.00317.77
8.1.50.0000.01217.70
8.1.40.0040.00417.60
8.1.30.0040.00417.83
8.1.20.0040.00417.80
8.1.10.0030.01017.77
8.1.00.0040.00417.70
8.0.300.0070.00020.26
8.0.290.0070.00016.75
8.0.280.0030.00318.37
8.0.270.0000.00718.09
8.0.260.0000.00718.61
8.0.250.0000.00617.00
8.0.240.0030.00516.95
8.0.230.0030.00517.04
8.0.220.0080.00017.02
8.0.210.0000.00716.92
8.0.200.0000.00717.00
8.0.190.0070.00016.99
8.0.180.0000.00717.04
8.0.170.0030.00617.05
8.0.160.0040.00417.10
8.0.150.0040.00416.86
8.0.140.0080.00017.04
8.0.130.0050.00013.43
8.0.120.0040.00416.95
8.0.110.0040.00417.10
8.0.100.0030.00516.87
8.0.90.0030.00617.12
8.0.80.0050.01117.01
8.0.70.0050.00516.94
8.0.60.0040.00416.98
8.0.50.0040.00416.90
8.0.30.0100.00717.14
8.0.20.0120.00916.89
8.0.10.0040.00417.09
8.0.00.0060.01216.97
7.4.330.0000.00515.55
7.4.320.0060.00016.82
7.4.300.0030.00316.82
7.4.290.0000.00716.65
7.4.280.0000.00816.80
7.4.270.0000.00716.73
7.4.260.0030.00313.48
7.4.250.0040.00416.70
7.4.240.0030.00316.63
7.4.230.0030.00316.86
7.4.220.0050.00216.71
7.4.210.0040.01216.74
7.4.200.0030.00616.74
7.4.130.0140.00316.65
7.4.120.0140.00316.56
7.4.110.0150.00316.81
7.4.100.0120.00616.52
7.4.90.0030.01416.43
7.4.80.0140.01316.63
7.4.70.0070.01016.63
7.4.60.0150.00316.63
7.4.50.0140.00316.59
7.4.40.0070.01116.42
7.4.30.0100.00716.40
7.4.20.0100.01816.45
7.4.10.0110.00716.52
7.4.00.0080.01616.58
7.3.330.0030.00516.00
7.3.320.0050.00012.98
7.3.310.0000.00716.30
7.3.300.0030.00316.10
7.3.290.0120.00516.22
7.3.260.0130.00316.18
7.3.250.0120.00616.16
7.3.240.0090.00816.21
7.3.230.0110.00716.10
7.3.220.0110.00616.19
7.3.210.0100.01316.37
7.3.200.0070.01116.26
7.3.190.0090.00916.20
7.3.180.0130.00316.25
7.3.170.0120.00616.09
7.3.160.0090.00916.27
7.3.150.0040.01316.07
7.3.140.0170.00016.11
7.3.130.0120.00816.14
7.3.120.0140.01016.37
7.3.110.0170.00616.13
7.3.100.0130.01016.11
7.3.90.0090.00916.16
7.3.80.0090.01216.02
7.3.70.0120.00916.18
7.3.60.0100.00716.09
7.3.50.0140.00316.05
7.3.40.0100.00616.10
7.3.30.0000.02016.22
7.3.20.0070.01116.23
7.3.10.0070.01016.05
7.3.00.0030.01416.17

preferences:
29.09 ms | 403 KiB | 5 Q