3v4l.org

run code in 500+ PHP versions simultaneously
<?php $searchData = ['%browser%', '%os%', '%city%']; $replaceData = ['Chrome', 'Windows', 'Delhi']; $str = 'When i work in %city% i was given with a laptop with %os% installed and it came with %browser%. everyone used `same %browser%` in our office.'; $rep = array_combine($searchData, $replaceData); $pattern = '~`[^`]*`(*SKIP)(*F)|' . implode('|', $searchData) . '~'; $result = preg_replace_callback($pattern, fn($m) => $rep[$m[0]], $str); echo $result;

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.5.70.0110.00617.07
8.5.60.0100.00416.84
8.5.50.0080.00818.49
8.5.30.0120.00618.79
8.5.20.0100.01019.48
8.5.10.0090.01016.79
8.5.00.0110.01020.17
8.4.210.0070.00219.92
8.4.180.0090.01223.72
8.4.170.0060.00419.82
8.4.160.0060.00519.93
8.4.150.0080.00516.94
8.4.140.0150.00617.80
8.4.130.0090.00718.00
8.4.120.0080.01220.63
8.4.110.0090.01120.04
8.4.100.0130.00818.82
8.4.90.0130.00822.55
8.4.80.0070.00218.71
8.4.70.0120.00818.41
8.4.60.0110.00818.87
8.4.50.0110.00718.80
8.4.40.0130.00717.82
8.4.30.0060.00318.64
8.4.20.0070.01517.82
8.4.10.0110.01119.58
8.3.300.0120.01120.46
8.3.290.0070.00318.52
8.3.280.0130.01020.69
8.3.270.0110.00816.69
8.3.260.0110.00916.82
8.3.250.0120.00818.98
8.3.240.0090.00617.23
8.3.230.0110.00916.79
8.3.220.0040.00418.83
8.3.210.0060.00216.92
8.3.200.0060.00516.70
8.3.190.0070.00617.18
8.3.180.0130.00616.86
8.3.170.0090.00920.43
8.3.160.0150.00616.54
8.3.150.0110.00717.27
8.3.140.0040.01118.55
8.3.130.0080.00018.63
8.3.120.0060.00318.87
8.3.110.0060.00320.94
8.3.100.0000.00816.73
8.3.90.0000.00826.77
8.3.80.0110.00017.00
8.3.70.0040.01118.43
8.3.60.0180.00416.75
8.3.50.0070.01018.24
8.3.40.0160.00318.92
8.3.30.0110.00418.79
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0080.00026.16
8.2.300.0100.00718.39
8.2.290.0060.00320.61
8.2.280.0050.00418.87
8.2.270.0090.00917.07
8.2.260.0040.00418.61
8.2.250.0090.00618.72
8.2.240.0040.00418.82
8.2.230.0090.00022.58
8.2.220.0110.00024.06
8.2.210.0090.00926.77
8.2.200.0090.00016.88
8.2.190.0120.00316.88
8.2.180.0000.01525.92
8.2.170.0150.00319.22
8.2.160.0120.00322.96
8.2.150.0070.00025.66
8.2.140.0040.00424.66
8.2.130.0030.00626.16
8.2.120.0040.00421.31
8.2.110.0030.00720.35
8.2.100.0040.00818.16
8.2.90.0000.00818.29
8.2.80.0040.00419.31
8.2.70.0000.00917.75
8.2.60.0030.00518.05
8.2.50.0030.00718.07
8.2.40.0000.00819.67
8.2.30.0080.00017.81
8.2.20.0040.00422.54
8.2.10.0040.00417.89
8.2.00.0070.00019.27
8.1.340.0120.00717.88
8.1.330.0110.00722.31
8.1.320.0090.01116.57
8.1.310.0000.00816.61
8.1.300.0100.01018.05
8.1.290.0000.00930.84
8.1.280.0040.01125.92
8.1.270.0000.00823.99
8.1.260.0000.00826.35
8.1.250.0150.00328.09
8.1.240.0040.00422.14
8.1.230.0110.00020.90
8.1.220.0040.00417.74
8.1.210.0000.00818.93
8.1.200.0040.00417.48
8.1.190.0040.00417.47
8.1.180.0040.00418.10
8.1.170.0040.00418.91
8.1.160.0020.00519.09
8.1.150.0000.00818.80
8.1.140.0040.00417.49
8.1.130.0030.00318.94
8.1.120.0070.00017.62
8.1.110.0040.00417.48
8.1.100.0090.00017.51
8.1.90.0000.00817.50
8.1.80.0000.00717.63
8.1.70.0040.00417.61
8.1.60.0000.00817.76
8.1.50.0000.00917.70
8.1.40.0040.00417.57
8.1.30.0050.00317.71
8.1.20.0070.00317.79
8.1.10.0040.00817.70
8.1.00.0080.00017.74
8.0.300.0040.00420.09
8.0.290.0060.00316.75
8.0.280.0000.00718.52
8.0.270.0000.00716.92
8.0.260.0060.00018.47
8.0.250.0000.00717.11
8.0.240.0070.00017.15
8.0.230.0000.00717.02
8.0.220.0040.00417.07
8.0.210.0000.00716.95
8.0.200.0070.00017.19
8.0.190.0080.00017.16
8.0.180.0070.00017.05
8.0.170.0040.00417.07
8.0.160.0000.00817.01
8.0.150.0000.00716.99
8.0.140.0000.00816.98
8.0.130.0150.00316.94
8.0.120.0150.00317.03
8.0.110.0150.00417.09
8.0.100.0150.00316.97
8.0.90.0140.00516.98
8.0.80.0200.00016.85
8.0.70.0120.00816.88
8.0.60.0100.00716.91
8.0.50.0140.00516.98
8.0.30.0110.00816.86
8.0.20.0160.00216.97
8.0.10.0180.00317.20
8.0.00.0060.00617.16
7.4.330.0020.00215.55
7.4.320.0000.00716.73
7.4.300.0030.00316.71
7.4.290.0040.00416.77
7.4.280.0000.00816.76
7.4.270.0030.00316.63
7.4.260.0170.00416.63
7.4.250.0160.00516.68
7.4.240.0160.00316.80
7.4.230.0130.00716.82
7.4.220.0120.00616.77
7.4.210.0060.01216.68
7.4.200.0190.00016.57
7.4.190.0130.00416.71
7.4.180.0000.01816.58
7.4.160.0170.00016.80
7.4.150.0130.00516.76
7.4.140.0160.00316.80
7.4.130.0130.00516.70
7.4.120.0160.00316.71
7.4.110.0110.01116.78
7.4.100.0160.00216.85
7.4.90.0080.01116.70
7.4.80.0160.00316.76
7.4.70.0060.01216.62
7.4.60.0170.00016.64
7.4.50.0150.00316.62
7.4.40.0130.00416.48
7.4.30.0120.00616.59
7.4.20.0180.00016.55
7.4.10.0130.00416.59
7.4.00.0170.00016.66
7.3.330.0130.00216.08
7.3.320.0120.00616.25
7.3.310.0150.00316.22
7.3.300.0120.00816.28
7.3.290.0130.00516.09
7.3.280.0150.00416.01
7.3.270.0110.00816.21
7.3.260.0100.00316.17
7.3.250.0090.00616.19
7.3.240.0100.00716.02
7.3.230.0090.00515.94
7.3.220.0170.00016.23
7.3.210.0170.00416.06
7.3.200.0160.00616.14
7.3.190.0210.00016.14
7.3.180.0160.00315.96
7.3.170.0130.00716.02
7.3.160.0190.00016.15
7.3.150.0120.00516.02
7.3.140.0100.00716.08
7.3.130.0130.00315.94
7.3.120.0040.00415.99
7.3.110.0050.00415.92
7.3.100.0090.00316.02
7.3.90.0100.00016.42
7.3.80.0070.00416.00
7.3.70.0100.00016.11
7.3.60.0090.00616.10
7.3.50.0140.00416.16
7.3.40.0180.00016.16
7.3.30.0100.00716.16
7.3.20.0140.00317.84
7.3.10.0150.00317.85
7.3.00.0190.00018.05
7.2.340.0030.00716.10
7.0.00.0060.00616.69
5.6.400.0050.00615.46
5.4.00.0040.00112.37

preferences:
95.74 ms | 1436 KiB | 5 Q