3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = "// blah blah blah\n\nconst filename = \"\";\n\n// blah blah blah"; echo preg_replace('~^(\h*const\s+filename\s*=\s*).+~mi', '$1"NEW VALUE";', $string);

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.0130.00718.76
8.4.110.0120.00718.88
8.4.100.0030.00517.89
8.4.90.0060.00617.88
8.4.80.0150.00518.88
8.4.70.0050.00718.02
8.4.60.0120.00818.70
8.4.50.0060.01418.42
8.4.40.0060.00317.54
8.4.30.0060.01320.30
8.4.20.0070.01419.59
8.4.10.0100.01017.75
8.3.250.0060.00516.71
8.3.240.0060.00418.50
8.3.230.0120.00716.54
8.3.220.0140.00518.98
8.3.210.0040.00416.77
8.3.200.0050.00416.76
8.3.190.0060.00417.25
8.3.180.0110.00416.55
8.3.170.0070.01120.59
8.3.160.0120.00617.18
8.3.150.0110.00720.48
8.3.140.0030.00516.97
8.3.130.0040.01116.79
8.3.120.0040.01118.95
8.3.110.0090.00020.94
8.3.100.0150.00424.06
8.3.90.0040.00426.77
8.3.80.0060.00318.30
8.3.70.0120.00316.58
8.3.60.0120.00316.75
8.3.50.0040.01418.26
8.3.40.0080.00520.29
8.3.30.0130.00318.92
8.3.20.0000.00924.18
8.3.10.0040.00424.66
8.3.00.0050.00326.16
8.2.290.0120.00820.53
8.2.280.0130.00518.27
8.2.270.0200.00017.25
8.2.260.0120.00618.36
8.2.250.0050.00317.05
8.2.240.0030.00619.00
8.2.230.0000.00822.58
8.2.220.0070.00337.54
8.2.210.0030.00526.77
8.2.200.0030.00616.63
8.2.190.0090.01218.53
8.2.180.0110.00425.92
8.2.170.0090.00619.03
8.2.160.0110.00422.96
8.2.150.0050.00225.66
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0080.00019.61
8.2.110.0090.00019.05
8.2.100.0030.01017.91
8.2.90.0000.00817.75
8.2.80.0060.00317.97
8.2.70.0080.00017.75
8.2.60.0060.00317.75
8.2.50.0030.00517.98
8.2.40.0040.00417.97
8.2.30.0040.00418.02
8.2.20.0000.00720.48
8.2.10.0040.00417.70
8.2.00.0000.00719.12
8.1.330.0100.00821.82
8.1.320.0140.00516.36
8.1.310.0050.00318.23
8.1.300.0040.00816.16
8.1.290.0090.00018.88
8.1.280.0090.01225.92
8.1.270.0030.00523.99
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0030.00619.43
8.1.230.0040.00717.77
8.1.220.0040.00417.78
8.1.210.0000.00818.77
8.1.200.0080.00017.35
8.1.190.0030.00617.25
8.1.180.0060.00318.10
8.1.170.0030.00617.62
8.1.160.0040.00418.79
8.1.150.0000.00718.69
8.1.140.0040.00417.54
8.1.130.0000.00718.82
8.1.120.0040.00417.55
8.1.110.0030.00717.48
8.1.100.0050.00917.46
8.1.90.0080.00617.43
8.1.80.0070.00617.49
8.1.70.0080.00517.42
8.1.60.0110.00517.63
8.1.50.0100.00517.54
8.1.40.0100.00417.59
8.1.30.0090.00717.69
8.1.20.0110.00417.63
8.1.10.0090.00617.56
8.1.00.0060.01017.54
8.0.300.0030.00618.77
8.0.290.0000.00717.00
8.0.280.0030.00320.26
8.0.270.0040.00417.02
8.0.260.0040.00418.47
8.0.250.0000.00816.98
8.0.240.0020.00517.04
8.0.230.0100.00216.87
8.0.220.0070.00616.86
8.0.210.0060.00616.89
8.0.200.0090.00316.87
8.0.190.0060.00616.96
8.0.180.0090.00416.89
8.0.170.0090.00316.95
8.0.160.0080.00516.92
8.0.150.0070.00616.90
8.0.140.0100.00316.86
8.0.130.0090.00416.86
8.0.120.0080.00416.85
8.0.110.0100.00216.86
8.0.100.0090.00416.86
8.0.90.0080.00516.93
8.0.80.0120.00116.84
8.0.70.0110.00216.82
8.0.60.0090.00416.84
8.0.50.0090.00416.93
8.0.30.0110.00216.92
8.0.20.0090.00416.96
8.0.10.0050.00817.08
7.4.330.0050.00015.55
7.4.320.0100.00416.66
7.4.300.0060.00716.58
7.4.290.0080.00516.63
7.4.280.0090.00516.66
7.4.270.0110.00316.59
7.4.260.0110.00216.65
7.4.250.0070.00616.64
7.4.240.0060.00216.67
7.4.230.0070.00416.64
7.4.220.0100.00316.62
7.4.210.0060.00716.72
7.4.200.0090.00416.63
7.4.190.0070.00416.66
7.4.180.0080.00316.71
7.4.160.0100.00216.68
7.4.150.0100.00416.61
7.4.140.0120.00216.62
7.4.130.0120.00116.67
7.4.120.0060.00616.55
7.4.110.0080.00416.47
7.4.100.0080.00416.68
7.4.90.0060.00616.64
7.4.80.0120.00116.58
7.4.70.0050.00816.59
7.4.60.0080.00516.73
7.4.50.0080.00416.60
7.4.40.0070.00616.62
7.4.30.0080.00416.65
7.4.20.0080.00416.55
7.4.10.0090.00316.53
7.4.00.0050.00316.58

preferences:
34.77 ms | 403 KiB | 5 Q