3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pattern = '/((?<!\w)#\w+)/i'; $subject = <<<EOT Blablalb #toto zdjsdf #ho_yeah EOT; $hashtags = []; $result = preg_replace_callback('/((?<!\w)#\w+)/i', function ($matches) use(&$hastags) { $hashtags[] = $matches[0]; return ''; }, $subject); var_dump($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.3.70.0120.00916.75
8.3.60.0000.01416.48
8.3.50.0100.01022.07
8.3.40.0070.00719.04
8.3.30.0120.00319.21
8.3.20.0000.00920.20
8.3.10.0080.00023.61
8.3.00.0040.00420.79
8.2.180.0130.00717.00
8.2.170.0100.00722.96
8.2.160.0130.00320.53
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0000.00821.04
8.2.110.0030.00722.03
8.2.100.0040.00717.97
8.2.90.0040.00417.78
8.2.80.0040.00417.97
8.2.70.0060.00517.75
8.2.60.0040.00818.16
8.2.50.0040.00418.07
8.2.40.0050.00319.40
8.2.30.0030.00518.28
8.2.20.0050.00317.96
8.2.10.0040.00418.02
8.2.00.0040.00417.77
8.1.280.0110.00325.92
8.1.270.0050.00323.84
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00622.42
8.1.230.0040.00820.93
8.1.220.0030.00517.74
8.1.210.0060.00318.97
8.1.200.0060.00317.47
8.1.190.0040.00417.35
8.1.180.0030.00718.10
8.1.170.0030.00518.81
8.1.160.0030.00621.95
8.1.150.0000.00718.79
8.1.140.0000.00717.48
8.1.130.0000.00717.91
8.1.120.0070.00017.61
8.1.110.0000.00917.64
8.1.100.0040.00417.66
8.1.90.0070.00017.59
8.1.80.0000.00817.61
8.1.70.0030.00317.47
8.1.60.0030.00617.63
8.1.50.0000.00817.63
8.1.40.0070.00017.58
8.1.30.0030.00617.81
8.1.20.0080.00017.72
8.1.10.0040.00417.66
8.1.00.0020.00517.66
8.0.300.0000.00720.04
8.0.290.0030.00517.05
8.0.280.0030.00518.45
8.0.270.0040.00417.18
8.0.260.0030.00317.27
8.0.250.0030.00317.20
8.0.240.0030.00617.22
8.0.230.0070.00017.02
8.0.220.0000.00717.01
8.0.210.0030.00317.11
8.0.200.0030.00517.04
8.0.190.0040.00417.18
8.0.180.0000.00817.18
8.0.170.0040.00417.02
8.0.160.0040.00417.14
8.0.150.0040.00417.01
8.0.140.0040.00416.96
8.0.130.0030.00313.53
8.0.120.0030.00517.16
8.0.110.0000.00717.05
8.0.100.0030.00317.16
8.0.90.0000.00716.93
8.0.80.0120.00317.02
8.0.70.0040.00417.16
8.0.60.0020.00516.99
8.0.50.0020.00517.16
8.0.30.0160.00417.27
8.0.20.0130.00717.40
8.0.10.0040.00417.22
8.0.00.0020.01616.96
7.4.330.0000.00515.10
7.4.320.0020.00516.85
7.4.300.0000.00616.73
7.4.290.0070.00016.70
7.4.280.0000.00716.80
7.4.270.0030.00316.57
7.4.260.0070.00016.68
7.4.250.0070.00016.66
7.4.240.0040.00416.72
7.4.230.0040.00416.88
7.4.220.0060.01116.61
7.4.210.0100.00816.72
7.4.200.0000.00716.84
7.4.190.0030.00516.57
7.4.160.0060.00916.81
7.4.150.0100.01317.40
7.4.140.0090.01217.86
7.4.130.0090.00816.83
7.4.120.0130.00416.74
7.4.110.0110.00516.69
7.4.100.0150.00316.65
7.4.90.0100.00716.77
7.4.80.0140.00919.39
7.4.70.0100.00616.76
7.4.60.0030.01316.71
7.4.50.0000.00816.44
7.4.40.0080.00816.58
7.4.30.0120.00616.65
7.4.00.0000.01415.16
7.3.330.0050.00013.43
7.3.320.0050.00013.37
7.3.310.0070.00016.45
7.3.300.0040.00416.52
7.3.290.0040.01016.59
7.3.280.0110.00516.49
7.3.270.0100.01317.40
7.3.260.0070.01116.78
7.3.250.0140.00516.61
7.3.240.0070.01016.55
7.3.230.0070.01016.45
7.3.210.0140.00416.83
7.3.200.0080.00819.39
7.3.190.0090.00916.77
7.3.180.0110.00716.52
7.3.170.0100.00616.79
7.3.160.0060.00916.59
7.3.120.0090.00614.76
7.2.330.0120.00916.85
7.2.320.0080.01116.69
7.2.310.0090.00916.76
7.2.300.0070.01116.61
7.2.290.0190.00416.78
7.2.00.0070.01019.68
7.1.100.0100.00618.41
7.1.70.0040.00417.44
7.1.60.0070.01719.46
7.1.50.0030.00716.83
7.1.00.0000.07322.30
7.0.200.0050.00316.84
7.0.140.0030.07721.92
7.0.60.0070.07020.04
7.0.50.0000.05717.89
7.0.40.0100.07720.16
7.0.30.0230.07720.09
7.0.20.0300.08020.26
7.0.10.0030.05720.11
7.0.00.0100.04720.27
5.6.280.0070.07020.82
5.6.210.0000.05020.73
5.6.200.0170.07318.18
5.6.190.0200.04320.63
5.6.180.0170.04320.48
5.6.170.0330.07020.54
5.6.160.0030.05720.55
5.6.150.0130.07318.16
5.6.140.0030.09018.13
5.6.130.0030.05018.17
5.6.120.0030.04021.00
5.6.110.0100.08020.89
5.6.100.0100.06020.98
5.6.90.0170.07720.95
5.6.80.0070.07720.44
5.5.350.0000.08320.32
5.5.340.0030.04017.99
5.5.330.0100.04020.26
5.5.320.0270.06020.24
5.5.310.0130.04320.34
5.5.300.0000.04018.08
5.5.290.0000.08718.07
5.5.280.0070.04020.77
5.5.270.0170.08020.89
5.5.260.0070.07720.96
5.5.250.0030.06320.50
5.5.240.0030.07720.17
5.4.450.0400.04319.55
5.4.440.0200.04019.32
5.4.430.0030.05319.18
5.4.420.0570.04319.32
5.4.410.0630.05019.05
5.4.400.0270.03719.25
5.4.390.0670.05019.20
5.4.380.0170.06318.58
5.4.370.0200.04718.80
5.4.360.0100.06018.74
5.4.350.0230.05318.76
5.4.340.0200.04718.74
5.4.320.0060.03712.51
5.4.310.0060.03912.50
5.4.300.0090.06712.50
5.4.290.0210.09112.50
5.4.280.0170.11712.39
5.4.270.0100.05012.39
5.4.260.0090.05512.39
5.4.250.0100.07112.39
5.4.240.0120.05812.39
5.4.230.0090.05712.39
5.4.220.0170.08612.39
5.4.210.0060.05112.39
5.4.200.0130.08112.39
5.4.190.0230.08212.38
5.4.180.0110.07212.38
5.4.170.0180.05112.40
5.4.160.0300.10212.39
5.4.150.0210.16012.39
5.4.140.0080.07312.07
5.4.130.0140.05112.06
5.4.120.0230.07312.02
5.4.110.0100.05212.01
5.4.100.0060.06012.02
5.4.90.0150.09012.02
5.4.80.0090.06412.02
5.4.70.0210.10012.01
5.4.60.0090.11412.01
5.4.50.0110.05512.01
5.4.40.0120.05512.00
5.4.30.0180.05112.00
5.4.20.0100.05611.99
5.4.10.0190.06512.00
5.4.00.0110.06111.48
5.3.290.0100.03712.80
5.3.280.0080.05412.71
5.3.270.0080.05512.72
5.3.260.0090.05412.72
5.3.250.0110.05712.71
5.3.240.0100.05312.72
5.3.230.0110.05012.71
5.3.220.0090.05312.68
5.3.210.0090.05512.68
5.3.200.0110.05212.68
5.3.190.0360.07212.68
5.3.180.0080.05612.67
5.3.170.0150.05212.67
5.3.160.0180.08812.67
5.3.150.0090.05912.67
5.3.140.0100.06912.66
5.3.130.0100.05412.66
5.3.120.0130.05212.66
5.3.110.0080.05512.66
5.3.100.0080.05112.12
5.3.90.0150.04612.08
5.3.80.0120.04812.07
5.3.70.0080.05512.08
5.3.60.0090.04912.06
5.3.50.0130.07212.00
5.3.40.0070.08812.00
5.3.30.0130.07411.95
5.3.20.0090.05211.73
5.3.10.0120.08611.70
5.3.00.0230.10211.68
5.2.170.0100.0569.18
5.2.160.0080.0429.18
5.2.150.0080.0429.18
5.2.140.0100.0589.18
5.2.130.0190.0869.14
5.2.120.0130.0919.14
5.2.110.0140.0759.15
5.2.100.0070.0399.14
5.2.90.0100.0359.14
5.2.80.0150.0659.14
5.2.70.0140.0909.14
5.2.60.0170.0919.09
5.2.50.0200.0899.06
5.2.40.0200.0609.04
5.2.30.0140.0379.01
5.2.20.0070.0419.00
5.2.10.0040.0468.92
5.2.00.0100.0408.79
5.1.60.0090.0348.07
5.1.50.0070.0378.07
5.1.40.0080.0428.05
5.1.30.0110.0338.39
5.1.20.0110.0348.42
5.1.10.0070.0348.14
5.1.00.0080.0358.14
5.0.50.0080.0286.62
5.0.40.0070.0306.48
5.0.30.0150.0376.29
5.0.20.0060.0296.26
5.0.10.0050.0326.25
5.0.00.0070.0416.24
4.4.90.0110.0164.78
4.4.80.0050.0394.76
4.4.70.0120.0394.75
4.4.60.0070.0374.75
4.4.50.0080.0434.77
4.4.40.0090.0464.71
4.4.30.0080.0354.76
4.4.20.0050.0564.84
4.4.10.0110.0544.85
4.4.00.0080.0594.75
4.3.110.0030.0464.67
4.3.100.0150.0274.66
4.3.90.0080.0274.64
4.3.80.0050.0534.58
4.3.70.0050.0194.63
4.3.60.0040.0284.63
4.3.50.0080.0464.62
4.3.40.0030.0314.54
4.3.30.0020.0213.28
4.3.20.0030.0203.26
4.3.10.0090.0153.22
4.3.00.0230.01312.58

preferences:
40.74 ms | 401 KiB | 5 Q