3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '§f§lWORDHERE'; $replacements = [ '§f' => '<span style="color: white;">$0</span>', '§l' => '<b>$0</b>', ]; if (preg_match('/^(?<flags>(?:§[a-z])+)(?<string>.*)/iu', $str, $matches)) { $str_res = $matches['string']; foreach (mb_str_split($matches['flags'], 2) as $flag) { $str_res = preg_replace('/.+/', $replacements[$flag], $str_res); } echo $str_res; }

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.00.0110.01020.17
8.4.150.0020.00014.05
8.4.140.0090.01218.06
8.4.130.0090.01318.04
8.4.120.0140.00623.95
8.4.110.0070.00323.58
8.4.100.0170.00419.13
8.4.90.0110.00918.88
8.4.80.0040.00419.88
8.4.70.0060.00618.16
8.4.60.0090.01119.01
8.4.50.0110.01018.02
8.4.40.0090.01218.71
8.4.30.0140.00720.31
8.4.20.0030.01317.88
8.4.10.0000.01119.78
8.3.280.0100.01218.47
8.3.270.0130.00616.54
8.3.260.0130.00617.18
8.3.250.0120.00618.99
8.3.240.0100.00917.22
8.3.230.0050.00716.98
8.3.220.0120.00718.90
8.3.210.0060.01516.76
8.3.200.0030.00716.95
8.3.190.0140.00619.06
8.3.180.0060.00218.75
8.3.170.0080.00417.25
8.3.160.0150.00416.77
8.3.150.0180.00019.10
8.3.140.0090.00017.03
8.3.130.0140.00318.46
8.3.120.0090.00018.91
8.3.110.0070.00416.89
8.3.100.0030.00624.06
8.3.90.0040.00426.77
8.3.80.0060.00316.88
8.3.70.0070.01417.00
8.3.60.0000.01418.81
8.3.50.0200.00623.73
8.3.40.0140.00321.77
8.3.30.0110.00418.95
8.3.20.0040.00424.18
8.3.10.0040.00424.66
8.3.00.0090.00026.16
8.2.290.0050.00320.45
8.2.280.0090.00718.68
8.2.270.0160.00319.07
8.2.260.0050.00318.92
8.2.250.0030.00616.83
8.2.240.0090.00019.08
8.2.230.0150.00420.94
8.2.220.0070.00337.54
8.2.210.0080.00026.77
8.2.200.0030.00617.00
8.2.190.0110.01116.75
8.2.180.0150.00025.92
8.2.170.0110.00419.21
8.2.160.0100.00322.96
8.2.150.0080.00025.66
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0040.00426.35
8.2.110.0060.00321.06
8.2.100.0000.01218.16
8.2.90.0080.00018.27
8.2.80.0000.00720.54
8.2.70.0050.00317.61
8.2.60.0040.00417.88
8.2.50.0090.00018.05
8.2.40.0050.00320.14
8.2.30.0000.00818.34
8.2.20.0000.00718.21
8.2.10.0000.00719.33
8.2.00.0040.00419.46
8.1.330.0110.00922.12
8.1.320.0070.00916.46
8.1.310.0080.00016.64
8.1.300.0060.00318.46
8.1.290.0030.00618.88
8.1.280.0160.00425.92
8.1.270.0060.00321.85
8.1.260.0040.00428.09
8.1.250.0000.00828.09
8.1.240.0030.00622.04
8.1.230.0120.00020.88
8.1.220.0040.00417.74
8.1.210.0000.00818.84
8.1.200.0030.00617.47
8.1.190.0000.00917.50
8.1.180.0040.00418.10
8.1.170.0040.00418.77
8.1.160.0040.00419.02
8.1.150.0050.00218.97
8.1.140.0000.00820.86
8.1.130.0030.00320.21
8.1.120.0080.00017.64
8.1.110.0000.00717.59
8.1.100.0070.00417.48
8.1.90.0030.00317.59
8.1.80.0040.00417.66
8.1.70.0000.01017.54
8.1.60.0030.00517.61
8.1.50.0000.00817.70
8.1.40.0000.00817.70
8.1.30.0000.00717.79
8.1.20.0000.01117.64
8.1.10.0000.00717.70
8.1.00.0050.00317.55
8.0.300.0000.00719.91
8.0.290.0070.00316.88
8.0.280.0030.00418.34
8.0.270.0070.00018.09
8.0.260.0030.00318.57
8.0.250.0040.00417.17
8.0.240.0040.00417.13
8.0.230.0040.00417.13
8.0.220.0030.00417.21
8.0.210.0070.00017.15
8.0.200.0030.00317.05
8.0.190.0000.00717.07
8.0.180.0000.00717.02
8.0.170.0000.00817.11
8.0.160.0000.00717.14
8.0.150.0070.00016.99
8.0.140.0040.00416.97
8.0.130.0000.00913.52
8.0.120.0080.00017.16
8.0.110.0040.00416.96
8.0.100.0040.00417.03
8.0.90.0000.00716.97
8.0.80.0100.00817.11
8.0.70.0000.00816.96
8.0.60.0080.00017.13
8.0.50.0030.00517.04
8.0.30.0120.01217.20
8.0.20.0150.00317.37
8.0.10.0040.00417.02
8.0.00.0120.00816.95
7.4.330.0020.00215.55
7.4.320.0000.00616.90
7.4.300.0030.00316.80
7.4.290.0070.00016.56
7.4.280.0040.00416.90
7.4.270.0070.00016.80
7.4.260.0060.00013.55
7.4.250.0030.00516.85
7.4.240.0000.00716.71
7.4.230.0030.00316.67
7.4.220.0020.00516.92
7.4.210.0080.00816.85
7.4.200.0080.00016.70
7.4.130.0080.01016.80
7.4.120.0130.01016.61
7.4.110.0060.01916.48
7.4.100.0110.00716.66
7.4.90.0100.01016.86
7.4.80.0170.00616.63
7.4.70.0060.01516.63
7.4.60.0100.01316.58
7.4.50.0240.00716.76
7.4.40.0060.01216.67
7.4.30.0090.00816.72
7.4.20.0060.01116.64
7.4.10.0110.00816.74
7.4.00.0150.00416.62
7.3.330.0050.00316.59
7.3.320.0000.00513.37
7.3.310.0000.00816.36
7.3.300.0070.00016.56
7.3.290.0070.00916.50
7.3.260.0090.01216.55
7.3.240.0160.00516.76
7.3.230.0120.00916.54
7.3.220.0140.00516.49
7.3.210.0130.01016.64
7.3.200.0120.00716.36
7.3.190.0090.00916.74
7.3.180.0120.01216.45
7.3.170.0230.00916.68
7.3.160.0060.01116.71
7.3.150.0080.00816.59
7.3.140.0090.00916.56
7.3.130.0090.00816.65
7.3.120.0110.01116.60
7.3.110.0100.01016.45
7.3.100.0200.00316.52
7.3.90.0100.01316.51
7.3.80.0170.00716.72
7.3.70.0030.01516.59
7.3.60.0070.01116.63
7.3.50.0140.00716.39
7.3.40.0150.00316.51
7.3.30.0080.01116.38
7.3.20.0210.00316.45
7.3.10.0210.00716.44
7.3.00.0260.00716.62
7.2.340.0150.00616.89
7.2.330.0180.00016.50
7.2.320.0150.00916.69
7.2.310.0160.00716.71
7.2.300.0230.00016.74
7.2.290.0160.00016.84
7.2.280.0040.01216.79
7.2.270.0000.01816.86
7.2.260.0140.00716.75
7.2.250.0110.01116.67
7.2.240.0090.00916.79
7.2.230.0080.01116.66
7.2.220.0140.01016.54
7.2.210.0130.00416.69
7.2.200.0090.00916.64
7.2.190.0090.00916.76
7.2.180.0130.00616.74
7.2.170.0140.00416.70
7.2.160.0110.01116.84
7.2.150.0160.01316.79
7.2.140.0160.00716.77
7.2.130.0060.01616.57
7.2.120.0160.00916.61
7.2.110.0130.01316.90
7.2.100.0130.01716.79
7.2.90.0170.01416.83
7.2.80.0250.00316.67
7.2.70.0190.01116.51
7.2.60.0240.00716.67
7.2.50.0210.01316.52
7.2.40.0240.00916.94
7.2.30.0180.01216.84
7.2.20.0130.02016.89
7.2.10.0300.00416.70
7.2.00.0220.01116.98

preferences:
36.69 ms | 403 KiB | 5 Q