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'; if (preg_match_all('~\[_wc_acof_(\d+)]~', $text, $matches)) { print_r($matches[1]); $replacements = [ '6' => 'NEW_VALUE_FOR_6_KEY', '9' => 'NEW_VALUE_FOR_9_KEY', '11' => 'NEW_VALUE_FOR_11_KEY' ]; echo preg_replace_callback('~\[_wc_acof_(\d+)]~', function($m) use ($replacements){ return $replacements[$m[1]]; }, $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.3.60.0000.01618.33
8.3.50.0180.00016.81
8.3.40.0120.00318.80
8.3.30.0130.00318.76
8.3.20.0080.00024.18
8.3.10.0000.00824.66
8.3.00.0040.00426.16
8.2.180.0070.01025.92
8.2.170.0140.00719.16
8.2.160.0190.00022.96
8.2.150.0070.00025.66
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0050.00326.16
8.2.110.0070.00320.87
8.2.100.0100.00318.27
8.2.90.0070.00418.92
8.2.80.0130.00619.42
8.2.70.0110.00818.25
8.2.60.0130.00618.32
8.2.50.0130.00618.27
8.2.40.0080.00719.94
8.2.30.0130.00418.90
8.2.20.0130.00518.39
8.2.10.0160.00218.92
8.2.00.0110.00718.85
8.1.280.0090.00625.92
8.1.270.0050.00322.05
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0060.00322.14
8.1.230.0160.00319.89
8.1.220.0150.00318.09
8.1.210.0150.00718.70
8.1.200.0160.00317.97
8.1.190.0080.01018.05
8.1.180.0120.00518.27
8.1.170.0110.00718.58
8.1.160.0130.00418.62
8.1.150.0150.00418.65
8.1.140.0160.00218.68
8.1.130.0090.00917.98
8.1.120.0100.00818.04
8.1.110.0160.00318.01
8.1.100.0100.00818.04
8.1.90.0100.00818.05
8.1.80.0190.00017.98
8.1.70.0080.00918.00
8.1.60.0160.00418.10
8.1.50.0120.00618.01
8.1.40.0150.00417.97
8.1.30.0140.00518.15
8.1.20.0150.00418.14
8.1.10.0110.00718.10
8.1.00.0130.00518.04
8.0.300.0110.00619.30
8.0.290.0140.00317.66
8.0.280.0150.00518.47
8.0.270.0130.00517.73
8.0.260.0110.00617.71
8.0.250.0130.00317.72
8.0.240.0080.00817.73
8.0.230.0130.00617.78
8.0.220.0120.00517.72
8.0.210.0150.00317.72
8.0.200.0160.00217.70
8.0.190.0120.00517.74
8.0.180.0120.00617.75
8.0.170.0120.00617.75
8.0.160.0110.00617.75
8.0.150.0120.00617.76
8.0.140.0160.00217.67
8.0.130.0130.00415.96
8.0.120.0130.00517.71
8.0.110.0120.00617.79
8.0.100.0130.00617.76
8.0.90.0180.00217.72
8.0.80.0250.00517.71
8.0.70.0210.00817.74
8.0.60.0180.00617.68
8.0.50.0140.01117.74
8.0.30.0180.00717.74
8.0.20.0180.01117.77
8.0.10.0170.00817.79
8.0.00.0230.00017.78
7.4.330.0110.00316.99
7.4.320.0130.00417.51
7.4.300.0160.00017.63
7.4.290.0140.00417.59
7.4.280.0130.00317.58
7.4.270.0110.00617.54
7.4.260.0080.00715.94
7.4.250.0090.00617.56
7.4.240.0100.00617.60
7.4.230.0110.00517.53
7.4.220.0120.00417.55
7.4.210.0140.00717.61
7.4.200.0200.00717.60
7.4.190.0150.00717.61
7.4.180.0180.00317.68
7.4.160.0140.00917.63
7.4.150.0120.01117.57
7.4.140.0140.01117.64
7.4.130.0200.00517.63
7.4.120.0140.00817.57
7.4.110.0150.00617.64
7.4.100.0110.01017.70
7.4.90.0190.00317.60
7.4.80.0170.00617.56
7.4.70.0090.01117.61
7.4.60.0180.00517.68
7.4.50.0210.00117.57
7.4.40.0120.01017.64
7.4.30.0170.00717.59
7.4.20.0170.00417.53
7.4.10.0110.01217.61
7.4.00.0170.00517.57
7.3.330.0100.00717.53
7.3.320.0130.00315.96
7.3.310.0130.00317.49
7.3.300.0110.00517.48
7.3.290.0140.00717.45
7.3.280.0130.01317.45
7.3.270.0130.00917.38
7.3.260.0130.00917.41
7.3.250.0140.00717.46
7.3.240.0120.00817.43
7.3.230.0110.00817.45
7.3.220.0160.00517.44
7.3.210.0170.01017.46
7.3.200.0130.00817.41
7.3.190.0150.00917.39
7.3.180.0140.01017.41
7.3.170.0170.00417.44
7.3.160.0140.00717.43
7.3.150.0110.00917.51
7.3.140.0210.00017.46
7.3.130.0200.00317.42
7.3.120.0120.00917.44
7.3.110.0150.00717.44
7.3.100.0150.00817.41
7.3.90.0140.00517.62
7.3.80.0170.00717.45
7.3.70.0190.00617.46
7.3.60.0200.00317.52
7.3.50.0120.00917.54
7.3.40.0190.00717.52
7.3.30.0170.00717.55
7.3.20.0150.00917.52
7.3.10.0190.00517.49
7.3.00.0200.00717.50
5.5.380.0120.00816.32

preferences:
46.79 ms | 401 KiB | 5 Q