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('/(\s#\w+)/i', function ($matches) use (&$hashtags) { var_dump($matches); $hashtags[] = trim($matches[0]); return ''; }, $subject); var_dump($result, $hashtags, http_build_query([ 'hashtags' => implode(',', $hashtags) ]));

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.0160.00616.98
8.3.50.0180.00322.20
8.3.40.0090.00918.84
8.3.30.0100.01019.17
8.3.20.0090.00320.18
8.3.10.0120.00623.53
8.3.00.0040.00420.90
8.2.180.0110.01117.13
8.2.170.0100.01022.96
8.2.160.0140.00720.43
8.2.150.0040.00424.18
8.2.140.0070.01024.66
8.2.130.0000.00726.16
8.2.120.0030.00620.85
8.2.110.0030.00622.30
8.2.100.0040.00819.34
8.2.90.0000.00819.29
8.2.80.0030.00517.97
8.2.70.0050.00617.88
8.2.60.0000.00917.93
8.2.50.0080.00018.07
8.2.40.0000.00821.33
8.2.30.0050.00318.41
8.2.20.0100.00317.98
8.2.10.0040.00418.09
8.2.00.0000.01018.05
8.1.280.0140.00725.92
8.1.270.0080.01123.68
8.1.260.0100.00726.35
8.1.250.0050.00328.09
8.1.240.0060.00323.76
8.1.230.0000.01118.97
8.1.220.0040.00417.79
8.1.210.0000.00818.77
8.1.200.0030.00617.35
8.1.190.0030.00517.25
8.1.180.0070.00518.10
8.1.170.0030.00518.77
8.1.160.0070.00021.93
8.1.150.0000.00718.80
8.1.140.0020.00517.61
8.1.130.0020.00517.88
8.1.120.0030.00317.66
8.1.110.0030.00617.70
8.1.100.0000.00717.57
8.1.90.0000.00817.61
8.1.80.0040.00417.58
8.1.70.0000.00717.66
8.1.60.0080.00017.77
8.1.50.0060.00317.57
8.1.40.0000.00817.71
8.1.30.0050.00317.86
8.1.20.0080.00017.79
8.1.10.0070.00017.71
8.1.00.0000.00817.66
8.0.300.0070.00018.77
8.0.290.0000.00817.05
8.0.280.0050.00218.38
8.0.270.0030.00317.28
8.0.260.0000.00717.29
8.0.250.0000.00717.18
8.0.240.0080.00017.06
8.0.230.0030.00517.21
8.0.220.0000.00716.98
8.0.210.0000.00717.06
8.0.200.0050.00317.05
8.0.190.0060.00317.23
8.0.180.0000.00817.11
8.0.170.0060.00317.16
8.0.160.0040.00417.13
8.0.150.0030.00517.07
8.0.140.0070.00016.98
8.0.130.0030.00313.55
8.0.120.0060.00317.03
8.0.110.0050.00317.13
8.0.100.0000.00716.91
8.0.90.0080.00016.95
8.0.80.0060.00917.05
8.0.70.0050.00316.98
8.0.60.0030.00517.00
8.0.50.0070.00016.96
8.0.30.0080.01017.19
8.0.20.0100.01317.40
8.0.10.0000.00817.29
8.0.00.0110.00716.96
7.4.330.0050.00015.10
7.4.320.0030.00316.62
7.4.300.0000.00616.62
7.4.290.0000.00816.71
7.4.280.0080.00016.71
7.4.270.0040.00416.72
7.4.260.0040.00416.71
7.4.250.0000.00716.73
7.4.240.0050.00216.83
7.4.230.0030.00616.84
7.4.220.0070.01116.89
7.4.210.0070.00816.74
7.4.200.0030.00316.81
7.4.190.0030.00516.91
7.4.160.0090.01316.70
7.4.150.0140.00417.40
7.4.140.0100.00817.86
7.4.130.0100.00716.70
7.4.120.0110.00716.77
7.4.110.0070.01016.57
7.4.100.0140.00416.67
7.4.90.0050.01316.92
7.4.80.0040.01519.39
7.4.70.0040.01216.62
7.4.60.0030.01316.78
7.4.50.0000.00816.57
7.4.40.0200.00016.81
7.4.30.0080.00816.69
7.4.00.0090.00614.92
7.3.330.0000.00613.44
7.3.320.0050.00013.52
7.3.310.0070.00016.59
7.3.300.0000.00816.50
7.3.290.0030.01216.54
7.3.280.0050.01316.51
7.3.270.0150.00317.40
7.3.260.0160.00816.78
7.3.250.0160.00616.52
7.3.240.0030.02016.72
7.3.230.0070.01116.58
7.3.210.0180.00816.66
7.3.200.0080.00919.39
7.3.190.0140.00516.66
7.3.180.0080.00816.62
7.3.170.0100.01016.75
7.3.160.0110.00716.63
7.3.120.0000.01314.78
7.3.10.0100.00316.48
7.3.00.0150.00416.40
7.2.330.0200.00816.77
7.2.320.0060.01616.89
7.2.310.0100.00616.56
7.2.300.0060.01116.84
7.2.290.0110.00616.63
7.2.130.0130.00716.57
7.2.120.0120.00517.02
7.2.110.0090.00616.49
7.2.100.0060.00616.97
7.2.90.0040.01117.01
7.2.80.0000.01016.86
7.2.70.0060.00617.00
7.2.60.0030.00716.90
7.2.50.0040.00717.20
7.2.40.0120.00617.02
7.2.30.0100.00317.12
7.2.20.0000.01516.82
7.2.10.0080.00816.63
7.2.00.0010.00918.13
7.1.250.0070.00715.75
7.1.100.0120.00318.35
7.1.70.0000.00717.52
7.1.60.0070.01819.46
7.1.50.0120.00917.20
7.1.00.0030.07722.55
7.0.200.0100.00316.88
7.0.140.0000.07722.04
7.0.60.0030.05019.87
7.0.50.0030.06317.90
7.0.40.0030.09720.11
7.0.30.0200.04320.26
7.0.20.0230.08320.34
7.0.10.0100.07720.11
7.0.00.0130.08020.24
5.6.280.0070.07020.87
5.6.210.0100.07320.66
5.6.200.0030.08318.24
5.6.190.0100.08320.67
5.6.180.0130.08020.75
5.6.170.0230.05720.59
5.6.160.0000.04720.47
5.6.150.0030.08318.12
5.6.140.0170.07718.24
5.6.130.0030.07318.28
5.6.120.0100.03321.00
5.6.110.0070.09320.99
5.6.100.0070.04320.97
5.6.90.0070.08021.13
5.6.80.0100.07720.37
5.5.350.0030.08020.32
5.5.340.0030.07718.08
5.5.330.0000.04320.37
5.5.320.0330.06020.31
5.5.310.0430.06320.34
5.5.300.0130.07317.97
5.5.290.0000.08717.98
5.5.280.0030.09020.77
5.5.270.0030.05720.75
5.5.260.0100.05020.77
5.5.250.0030.08720.59
5.5.240.0070.07320.04
5.4.450.0270.04019.20
5.4.440.0400.03319.41
5.4.430.0530.04319.56
5.4.420.0270.04319.38
5.4.410.0300.04019.28
5.4.400.0300.03319.23
5.4.390.0570.04319.06
5.4.380.1170.06318.84
5.4.370.1530.06318.58
5.4.360.1130.04718.76
5.4.350.0900.06018.86
5.4.340.1200.05318.81
5.4.320.0040.03712.50
5.4.310.0070.03712.50
5.4.300.0050.04312.50
5.4.290.0070.04912.50
5.4.280.0080.04012.40
5.4.270.0080.04612.40
5.4.260.0150.04412.40
5.4.250.0040.05012.40
5.4.240.0090.04112.39
5.4.230.0110.04112.39
5.4.220.0040.04312.38
5.4.210.0100.03412.38
5.4.200.0080.04012.39
5.4.190.0060.03712.38
5.4.180.0080.04012.38
5.4.170.0070.04112.39
5.4.160.0070.03812.39
5.4.150.0040.04212.39
5.4.140.0050.04412.07
5.4.130.0050.04012.06
5.4.120.0060.03712.02
5.4.110.0120.04512.01
5.4.100.0110.04412.01
5.4.90.0090.03912.01
5.4.80.0080.04712.01
5.4.70.0040.05112.01
5.4.60.0060.04312.01
5.4.50.0070.03912.01
5.4.40.0060.03812.00
5.4.30.0100.04311.99
5.4.20.0070.04111.99
5.4.10.0040.03911.99
5.4.00.0060.03811.48
5.3.290.0060.03812.80
5.3.280.0080.04012.70
5.3.270.0080.03912.72
5.3.260.0100.03912.72
5.3.250.0070.04212.72
5.3.240.0060.04512.72
5.3.230.0060.03812.71
5.3.220.0090.03612.68
5.3.210.0050.04312.68
5.3.200.0080.03712.68
5.3.190.0050.04012.68
5.3.180.0090.03712.68
5.3.170.0070.03812.67
5.3.160.0080.03712.68
5.3.150.0060.03812.67
5.3.140.0060.03812.66
5.3.130.0060.04012.65
5.3.120.0070.03912.65
5.3.110.0060.04012.65
5.3.100.0080.03512.12
5.3.90.0050.03712.09
5.3.80.0050.05512.07
5.3.70.0070.03612.07
5.3.60.0080.03512.06
5.3.50.0090.03412.00
5.3.40.0060.03612.00
5.3.30.0060.03911.95
5.3.20.0070.03511.72
5.3.10.0050.03711.70
5.3.00.0070.03711.68
5.2.170.0040.0329.18
5.2.160.0060.0439.18
5.2.150.0110.0399.18
5.2.140.0070.0439.17
5.2.130.0080.0409.14
5.2.120.0060.0339.14
5.2.110.0050.0299.15
5.2.100.0040.0349.14
5.2.90.0090.0439.14
5.2.80.0120.0499.14
5.2.70.0060.0489.14
5.2.60.0060.0479.09
5.2.50.0050.0449.05
5.2.40.0060.0309.04
5.2.30.0090.0409.01
5.2.20.0090.0399.01
5.2.10.0070.0508.93
5.2.00.0060.0408.78
5.1.60.0080.0318.07
5.1.50.0070.0318.06
5.1.40.0050.0378.04
5.1.30.0080.0458.40
5.1.20.0050.0678.42
5.1.10.0100.0458.14
5.1.00.0090.0388.14
5.0.50.0060.0306.62
5.0.40.0030.0336.48
5.0.30.0050.0476.30
5.0.20.0070.0276.27
5.0.10.0090.0266.25
5.0.00.0040.0456.24
4.4.90.0020.0274.78
4.4.80.0060.0484.75
4.4.70.0120.0424.75
4.4.60.0100.0274.75
4.4.50.0150.0304.77
4.4.40.0040.0634.71
4.4.30.0070.0504.76
4.4.20.0060.0354.85
4.4.10.0060.0234.85
4.4.00.0060.0314.76
4.3.110.0040.0174.67
4.3.100.0030.0184.66
4.3.90.0030.0224.63
4.3.80.0060.0254.58
4.3.70.0020.0154.63
4.3.60.0020.0164.62
4.3.50.0050.0144.63
4.3.40.0010.0274.54
4.3.30.0020.0173.28
4.3.20.0030.0173.26
4.3.10.0010.0183.23
4.3.00.0070.01012.59

preferences:
41.16 ms | 401 KiB | 5 Q