3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = '[_wc_acof_6] i want to convert this and it contains also this [_wc_acof_9] or can be this [_wc_acof_11] number can never be static'; $replacements = [ '6' => 'NEW_VALUE_FOR_6_KEY', '9' => 'NEW_VALUE_FOR_9_KEY' ]; echo preg_replace_callback('~\[_wc_acof_(\d+)]~', function($m) use ($replacements){ return isset($replacements[$m[1]]) ? $replacements[$m[1]] : $m[0]; }, $text);

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.10.0120.00518.50
8.5.00.0150.00720.30
8.4.150.0030.00014.05
8.4.140.0060.01517.54
8.4.130.0120.00918.02
8.4.120.0050.00320.59
8.4.110.0090.00918.82
8.4.100.0050.00418.29
8.4.90.0110.00820.51
8.4.80.0130.00718.29
8.4.70.0110.00918.07
8.4.60.0130.00718.10
8.4.50.0060.00219.01
8.4.40.0030.00619.68
8.4.30.0050.00320.25
8.4.20.0060.01320.55
8.4.10.0050.00519.74
8.3.280.0130.00818.75
8.3.270.0110.00916.66
8.3.260.0060.00316.76
8.3.250.0100.00518.82
8.3.240.0160.00316.72
8.3.230.0100.00916.84
8.3.220.0050.00717.16
8.3.210.0090.01016.66
8.3.200.0070.00716.74
8.3.190.0110.00517.23
8.3.180.0090.00919.08
8.3.170.0130.00618.64
8.3.160.0110.00719.06
8.3.150.0100.00616.92
8.3.140.0030.00618.93
8.3.130.0030.00618.45
8.3.120.0040.01520.63
8.3.110.0030.00616.92
8.3.100.0090.00016.54
8.3.90.0050.00326.77
8.3.80.0040.00419.36
8.3.70.0120.00616.75
8.3.60.0120.00618.56
8.3.50.0070.00716.43
8.3.40.0110.00318.92
8.3.30.0090.00618.80
8.3.20.0040.00424.18
8.3.10.0030.00624.66
8.3.00.0050.00326.16
8.2.290.0110.00720.30
8.2.280.0120.00616.86
8.2.270.0110.00718.54
8.2.260.0160.00317.18
8.2.250.0050.00316.60
8.2.240.0050.00317.38
8.2.230.0090.00020.94
8.2.220.0040.00424.06
8.2.210.0090.00326.77
8.2.200.0090.00018.88
8.2.190.0100.00616.88
8.2.180.0120.00325.92
8.2.170.0120.00319.09
8.2.160.0070.00722.96
8.2.150.0060.00325.66
8.2.140.0000.00724.66
8.2.130.0080.00026.16
8.2.120.0080.00026.16
8.2.110.0070.00421.05
8.2.100.0040.00818.09
8.2.90.0030.00619.17
8.2.80.0080.00017.97
8.2.70.0000.00817.88
8.2.60.0080.00017.93
8.2.50.0000.00818.07
8.2.40.0040.00418.16
8.2.30.0000.00918.24
8.2.20.0000.00818.34
8.2.10.0030.00619.28
8.2.00.0040.00419.26
8.1.330.0080.01022.14
8.1.320.0090.01016.43
8.1.310.0120.00616.60
8.1.300.0100.00718.43
8.1.290.0090.00030.84
8.1.280.0100.00325.92
8.1.270.0070.00323.99
8.1.260.0040.00426.35
8.1.250.0090.00028.09
8.1.240.0090.00021.29
8.1.230.0120.00017.82
8.1.220.0040.00417.76
8.1.210.0050.00518.77
8.1.200.0030.00617.35
8.1.190.0040.00417.48
8.1.180.0050.00318.10
8.1.170.0040.00418.71
8.1.160.0080.00018.98
8.1.150.0000.00918.92
8.1.140.0040.00418.92
8.1.130.0000.00720.30
8.1.120.0040.00417.59
8.1.110.0070.00017.61
8.1.100.0000.00917.50
8.1.90.0080.00017.62
8.1.80.0070.00317.62
8.1.70.0000.01117.45
8.1.60.0040.00417.75
8.1.50.0040.00417.71
8.1.40.0060.00317.57
8.1.30.0040.00417.83
8.1.20.0040.00417.83
8.1.10.0060.00317.77
8.1.00.0060.00317.64
8.0.300.0000.00718.77
8.0.290.0040.00416.75
8.0.280.0000.00818.52
8.0.270.0000.00718.07
8.0.260.0000.00618.51
8.0.250.0070.00017.12
8.0.240.0040.00417.00
8.0.230.0070.00017.18
8.0.220.0000.00816.91
8.0.210.0000.00817.02
8.0.200.0030.00317.06
8.0.190.0000.00817.12
8.0.180.0000.00716.95
8.0.170.0030.00617.03
8.0.160.0040.00416.99
8.0.150.0050.00216.99
8.0.140.0070.00016.97
8.0.130.0030.00313.48
8.0.120.0030.00617.06
8.0.110.0070.00016.93
8.0.100.0000.00717.04
8.0.90.0000.00716.93
8.0.80.0330.00716.90
8.0.70.0310.00416.96
8.0.60.0170.01716.92
8.0.50.0230.01216.86
8.0.30.0250.00816.94
8.0.20.0360.02217.03
8.0.10.0320.00617.17
8.0.00.0090.00917.20
7.4.330.0020.00215.55
7.4.320.0040.00416.83
7.4.300.0030.00316.81
7.4.290.0050.00316.66
7.4.280.0070.00316.56
7.4.270.0040.00316.71
7.4.260.0000.00513.44
7.4.250.0000.00816.66
7.4.240.0040.00416.73
7.4.230.0070.00016.71
7.4.220.0070.00016.82
7.4.210.0180.01516.78
7.4.200.0270.00816.75
7.4.190.0240.00716.72
7.4.180.0200.01216.80
7.4.160.0310.00316.80
7.4.150.0240.01116.81
7.4.140.0200.01216.83
7.4.130.0300.00316.63
7.4.120.0190.01616.84
7.4.110.0290.00516.75
7.4.100.0200.01316.83
7.4.90.0210.01916.71
7.4.80.0220.00916.64
7.4.70.0220.01116.80
7.4.60.0240.01016.71
7.4.50.0230.01016.69
7.4.40.0180.01316.65
7.4.30.0180.01216.65
7.4.20.0310.00716.74
7.4.10.0270.01216.75
7.4.00.0200.00916.83
7.3.330.0050.00316.56
7.3.320.0000.00513.47
7.3.310.0040.00416.42
7.3.300.0050.00316.38
7.3.290.0290.00616.41
7.3.280.0170.01316.36
7.3.270.0260.00616.46
7.3.260.0280.00716.42
7.3.250.0270.00516.46
7.3.240.0270.00316.45
7.3.230.0150.01516.38
7.3.220.0240.01116.45
7.3.210.0310.00316.46
7.3.200.0170.01116.49
7.3.190.0240.00716.46
7.3.180.0300.00416.37
7.3.170.0220.00416.44
7.3.160.0160.01516.38
7.3.150.0280.00316.41
7.3.140.0190.00616.34
7.3.130.0110.01416.40
7.3.120.0190.00616.50
7.3.110.0090.01516.32
7.3.100.0240.00916.41
7.3.90.0240.00916.67
7.3.80.0270.00516.42
7.3.70.0190.00516.58
7.3.60.0250.00416.62
7.3.50.0150.01216.49
7.3.40.0130.01316.62
7.3.30.0180.00816.50
7.3.20.0210.01216.65
7.3.10.0210.00716.55
7.3.00.0200.00416.58

preferences:
180.54 ms | 403 KiB | 5 Q