3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getHashtags($string) { $hashtags= FALSE; preg_match_all("/(#\w+)/u", $string, $matches); if ($matches) { $hashtagsArray = array_count_values($matches[0]); var_dump($hashtagsArray); $hashtags = array_keys($hashtagsArray); } return $hashtags; } var_export( getHashtags( 'Valid hashtags include: #hashtag #NYC2016 #foo #NYC_2016 #gøypålandet! #foo #bar #cat #cat #cat #cat' ) );

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.4.140.0100.01017.67
8.4.130.0140.00718.06
8.4.120.0070.01120.34
8.4.110.0140.00618.90
8.4.100.0130.00618.02
8.4.90.0100.01022.70
8.4.80.0090.01018.83
8.4.70.0130.00717.88
8.4.60.0120.00918.89
8.4.50.0080.01318.00
8.4.40.0000.01617.66
8.4.30.0080.01120.64
8.4.20.0030.00619.75
8.4.10.0090.00019.46
8.3.270.0070.01216.60
8.3.260.0100.00916.91
8.3.250.0090.01018.85
8.3.240.0100.01016.97
8.3.230.0120.00716.70
8.3.220.0130.00718.80
8.3.210.0080.00818.85
8.3.200.0050.00417.04
8.3.190.0070.00219.19
8.3.180.0100.00816.64
8.3.170.0050.00316.78
8.3.160.0110.00717.19
8.3.150.0150.00416.68
8.3.140.0040.01420.78
8.3.130.0030.00716.72
8.3.120.0030.01320.59
8.3.110.0040.00416.94
8.3.100.0040.00416.77
8.3.90.0340.01416.67
8.3.80.0350.01616.50
8.3.70.0350.01216.88
8.3.60.0420.00716.36
8.3.50.0350.01516.63
8.3.40.0310.00817.75
8.3.30.0320.00417.63
8.3.20.0330.00717.60
8.3.10.0330.00317.88
8.3.00.0430.00017.61
8.2.290.0080.00618.86
8.2.280.0100.00822.33
8.2.270.0090.00916.86
8.2.260.0130.00717.23
8.2.250.0170.00016.81
8.2.240.0090.00017.20
8.2.230.0040.00420.94
8.2.220.0100.00024.06
8.2.210.0290.01016.20
8.2.200.0340.00716.75
8.2.190.0280.01116.38
8.2.180.0260.01016.63
8.2.170.0360.01117.50
8.2.160.0400.00917.75
8.2.150.0140.00717.74
8.2.140.0240.00617.38
8.2.130.0300.00317.50
8.2.120.0320.01017.63
8.2.110.0320.00617.75
8.2.100.0470.00717.59
8.2.90.0440.00317.50
8.2.80.0310.00617.75
8.2.70.0170.00717.48
8.2.60.0180.00417.75
8.2.50.0120.00917.62
8.2.40.0270.00317.75
8.2.30.0320.01117.75
8.2.20.0330.00717.59
8.2.10.0340.00317.75
8.2.00.0180.00317.50
8.1.330.0100.00916.19
8.1.320.0150.00616.40
8.1.310.0060.00916.86
8.1.300.0050.00317.97
8.1.290.0210.01416.00
8.1.280.0340.00615.98
8.1.270.0200.01617.50
8.1.260.0350.00917.35
8.1.250.0330.00917.36
8.1.240.0250.00617.36
8.1.230.0270.01217.38
8.1.220.0240.01617.50
8.1.210.0320.01217.13
8.1.200.0430.01317.13
8.1.190.0320.00617.10
8.1.180.0240.00617.13
8.1.170.0260.00717.46
8.1.160.0310.00017.38
8.1.150.0350.00317.25
8.1.140.0210.01717.38
8.1.130.0310.00317.35
8.1.120.0320.00717.25
8.1.110.0310.01017.34
8.1.100.0370.00317.38
8.1.90.0260.01517.11
8.1.80.0280.01217.25
8.1.70.0350.00417.11
8.1.60.0420.00017.36
8.1.50.0280.01517.47
8.1.40.0330.01117.63
8.1.30.0280.01617.59
8.1.20.0180.00917.36
8.1.10.0250.00717.50
8.1.00.0190.01617.38

preferences:
29.43 ms | 403 KiB | 5 Q