3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = 'Samsung UN32EH4003 32-inch 720p 60Hz LED HDTV (Black)'; echo shorten_string($string); function shorten_string($string,$count=5){ $arr = preg_split('/[,\ \.;]/', $string); $keywords = array_unique($arr); $i=0; $rtn = ''; foreach ($keywords as $keyword){ if ((preg_match("/^[a-z0-9]/", $keyword) ) && (strlen($keyword) > 3)){ $rtn .= $keyword.' '; $i++; if ($i==$count) break; } } return trim($rtn); }

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.0060.00918.68
8.3.50.0110.00822.18
8.3.40.0100.01018.88
8.3.30.0110.00319.07
8.3.20.0040.00420.09
8.3.10.0080.00023.71
8.3.00.0040.00420.57
8.2.180.0070.00716.88
8.2.170.0070.00722.96
8.2.160.0070.01022.38
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0090.00617.75
8.2.110.0000.00922.12
8.2.100.0090.00318.03
8.2.90.0040.00419.34
8.2.80.0080.00018.16
8.2.70.0060.00617.63
8.2.60.0000.00917.93
8.2.50.0090.00018.07
8.2.40.0060.00318.28
8.2.30.0040.00418.14
8.2.20.0050.00317.98
8.2.10.0040.00417.76
8.2.00.0040.00418.00
8.1.280.0110.00725.92
8.1.270.0050.00523.92
8.1.260.0120.00326.35
8.1.250.0040.00428.09
8.1.240.0050.00523.82
8.1.230.0040.00719.16
8.1.220.0090.00017.79
8.1.210.0050.00318.77
8.1.200.0000.00817.35
8.1.190.0050.00317.43
8.1.180.0060.00318.10
8.1.170.0030.00518.78
8.1.160.0000.00722.04
8.1.150.0030.00518.79
8.1.140.0040.00417.60
8.1.130.0040.00417.82
8.1.120.0000.00817.56
8.1.110.0040.00417.63
8.1.100.0040.00317.64
8.1.90.0030.00617.66
8.1.80.0040.00417.59
8.1.70.0070.00017.63
8.1.60.0040.00417.65
8.1.50.0040.00417.55
8.1.40.0050.00317.64
8.1.30.0050.00317.82
8.1.20.0000.00717.71
8.1.10.0060.00317.70
8.1.00.0040.00417.51
8.0.300.0060.00318.77
8.0.290.0000.00717.18
8.0.280.0000.00818.33
8.0.270.0050.00217.18
8.0.260.0030.00316.87
8.0.250.0040.00317.12
8.0.240.0030.00617.09
8.0.230.0000.00717.08
8.0.220.0000.00717.07
8.0.210.0030.00317.06
8.0.200.0000.00717.12
8.0.190.0070.00016.98
8.0.180.0000.01017.11
8.0.170.0000.00817.06
8.0.160.0030.00616.98
8.0.150.0070.00016.87
8.0.140.0040.00416.89
8.0.130.0000.00513.42
8.0.120.0020.00517.04
8.0.110.0000.00716.93
8.0.100.0050.00316.94
8.0.90.0000.00716.95
8.0.80.0000.01616.99
8.0.70.0070.00016.97
8.0.60.0040.00417.09
8.0.50.0030.00517.03
8.0.30.0100.01017.18
8.0.20.0090.00917.40
8.0.10.0030.00617.13
8.0.00.0050.01517.02
7.4.330.0050.00015.22
7.4.320.0000.00616.71
7.4.300.0070.00016.70
7.4.290.0000.00716.73
7.4.280.0000.00716.72
7.4.270.0030.00316.80
7.4.260.0030.00316.69
7.4.250.0030.00516.67
7.4.240.0040.00416.81
7.4.230.0080.00016.91
7.4.220.0090.00616.80
7.4.210.0090.00616.82
7.4.200.0000.00816.92
7.4.190.0030.00316.58
7.4.160.0060.01616.61
7.4.150.0130.00317.40
7.4.140.0100.00717.86
7.4.130.0080.01416.90
7.4.120.0080.00916.73
7.4.110.0060.01716.88
7.4.100.0060.01216.63
7.4.90.0100.00716.79
7.4.80.0030.01416.75
7.4.70.0140.00416.81
7.4.60.0130.00316.69
7.4.50.0000.00416.79
7.4.40.0070.00722.77
7.4.30.0100.00716.68
7.4.00.0030.00715.34
7.3.330.0000.00613.29
7.3.320.0000.00513.32
7.3.310.0070.00016.52
7.3.300.0030.00316.48
7.3.290.0060.01316.48
7.3.280.0060.01016.52
7.3.270.0030.01417.40
7.3.260.0120.01616.64
7.3.250.0140.00816.66
7.3.240.0040.01216.52
7.3.230.0090.01216.86
7.3.210.0100.00716.37
7.3.200.0120.00919.39
7.3.190.0140.00716.55
7.3.180.0120.00316.46
7.3.170.0070.01016.43
7.3.160.0070.01016.61
7.3.120.0070.00715.04
7.2.330.0130.00616.84
7.2.320.0050.01916.86
7.2.310.0100.00716.88
7.2.300.0000.01616.91
7.2.290.0080.00816.80
7.2.120.0030.00916.88
7.2.110.0060.00616.88
7.2.100.0090.00316.83
7.2.90.0070.00716.93
7.2.80.0000.01517.00
7.2.70.0070.01017.17
7.2.60.0050.00517.23
7.2.50.0030.01017.02
7.2.40.0030.00616.98
7.2.30.0070.00717.14
7.2.20.0070.00717.16
7.2.10.0090.00617.13
7.2.00.0040.00718.46
7.1.240.0040.01116.00
7.1.230.0030.00915.62
7.1.220.0040.01215.92
7.1.210.0070.00716.02
7.1.200.0070.00316.04
7.1.190.0080.00815.90
7.1.180.0060.00616.10
7.1.170.0080.00015.71
7.1.160.0030.01216.06
7.1.150.0030.01015.97
7.1.140.0030.00615.97
7.1.130.0090.00316.07
7.1.120.0060.00615.98
7.1.110.0100.00015.86
7.1.100.0060.00717.09
7.1.90.0000.01015.70
7.1.80.0030.01015.97
7.1.70.0070.00616.68
7.1.60.0070.01017.55
7.1.50.0110.00716.64
7.1.40.0060.00616.05
7.1.30.0000.01215.97
7.1.20.0030.01016.11
7.1.10.0060.00615.97
7.1.00.0050.03919.24
7.0.320.0110.00415.28
7.0.310.0030.01315.73
7.0.300.0080.00415.68
7.0.290.0040.01115.48
7.0.280.0100.00315.40
7.0.270.0030.00715.46
7.0.260.0040.01115.27
7.0.250.0030.00815.57
7.0.240.0040.00915.54
7.0.230.0090.00315.72
7.0.220.0070.00715.68
7.0.210.0090.00315.45
7.0.200.0060.00416.04
7.0.190.0000.01215.71
7.0.180.0070.00315.87
7.0.170.0070.00715.54
7.0.160.0060.00615.57
7.0.150.0030.00715.75
7.0.140.0030.04018.89
7.0.130.0000.00815.83
7.0.120.0030.01015.62
7.0.110.0060.00615.51
7.0.100.0030.01015.55
7.0.90.0100.00615.81
7.0.80.0000.01115.25
7.0.70.0050.04218.64
7.0.60.0050.03018.69
7.0.50.0050.03318.80
7.0.40.0050.04516.93
7.0.30.0090.04216.94
7.0.20.0130.04016.84
7.0.10.0080.03217.00
7.0.00.0050.04816.78
5.6.380.0030.01014.66
5.6.370.0040.00814.66
5.6.360.0080.00314.77
5.6.350.0040.01214.48
5.6.340.0060.00614.11
5.6.330.0040.00814.40
5.6.320.0030.01314.72
5.6.310.0000.01014.58
5.6.300.0070.00714.43
5.6.290.0030.01014.48
5.6.280.0030.04217.78
5.6.270.0090.00314.43
5.6.260.0120.00314.52
5.6.250.0040.00414.42
5.6.240.0090.00614.82
5.6.230.0040.01114.59
5.6.220.0040.04417.48
5.6.210.0040.03517.51
5.6.200.0050.04217.90
5.6.190.0080.04117.85
5.6.180.0080.04017.78
5.6.170.0020.04017.67
5.6.160.0050.04617.75
5.6.150.0070.04517.71
5.6.140.0040.04517.71
5.6.130.0020.05017.65
5.6.120.0080.04317.71
5.6.110.0060.04317.71
5.6.100.0010.02917.71
5.6.90.0020.05017.75
5.6.80.0130.03817.28
5.6.70.0080.04517.35
5.6.60.0070.02017.31
5.6.50.0080.03317.38
5.6.40.0020.04517.42
5.6.30.0030.03417.34
5.6.20.0020.04417.44
5.6.10.0100.03717.40
5.6.00.0050.04217.42
5.5.380.0050.00311.29
5.5.370.0070.00411.46
5.5.360.0030.04515.92
5.5.350.0080.02516.00
5.5.340.0050.02616.09
5.5.330.0100.04016.07
5.5.320.0030.02716.02
5.5.310.0020.04816.08
5.5.300.0030.04416.13
5.5.290.0020.02516.19
5.5.280.0030.04716.15
5.5.270.0090.03916.07
5.5.260.0020.04416.16
5.5.250.0050.02715.88
5.5.240.0010.04815.85
5.5.230.0020.05015.57
5.5.220.0020.04215.85
5.5.210.0060.04115.59
5.5.200.0130.03515.63
5.5.190.0050.04415.60
5.5.180.0050.04115.66
5.5.170.0040.01114.20
5.5.160.0030.04215.63
5.5.150.0090.02815.82
5.5.140.0060.03815.69
5.5.130.0060.02415.69
5.5.120.0030.04315.59
5.5.110.0040.03215.71
5.5.100.0020.02715.69
5.5.90.0030.02415.66
5.5.80.0020.02115.71
5.5.70.0050.02215.59
5.5.60.0030.04015.75
5.5.50.0030.03615.53
5.5.40.0070.04315.52
5.5.30.0060.02515.53
5.5.20.0020.04815.60
5.5.10.0030.04215.65
5.5.00.0080.04115.68
5.4.450.0020.03615.42
5.4.440.0040.02515.40
5.4.430.0030.02315.40
5.4.420.0050.02615.38
5.4.410.0070.04015.37
5.4.400.0030.03215.01
5.4.390.0060.03815.15
5.4.380.0030.02415.19
5.4.370.0030.04115.11
5.4.360.0040.04015.17
5.4.350.0030.03415.15
5.4.340.0020.04215.06
5.4.330.0030.00611.33
5.4.320.0020.04415.05
5.4.310.0020.04015.02
5.4.300.0060.02515.21
5.4.290.0070.03515.07
5.4.280.0020.04415.00
5.4.270.0040.03515.05
5.4.260.0000.02614.99
5.4.250.0030.03514.89
5.4.240.0040.03315.21
5.4.230.0050.03515.03
5.4.220.0050.03815.17
5.4.210.0070.03215.19
5.4.200.0070.02815.23
5.4.190.0020.04615.10
5.4.180.0030.03215.08
5.4.170.0030.02815.14
5.4.160.0030.04015.17
5.4.150.0020.04115.15
5.4.140.0050.04013.80
5.4.130.0060.03613.90
5.4.120.0030.03313.81
5.4.110.0050.03913.96
5.4.100.0020.04113.81
5.4.90.0020.03513.76
5.4.80.0080.03213.81
5.4.70.0050.03313.81
5.4.60.0030.03313.88
5.4.50.0030.02813.63
5.4.40.0040.02813.96
5.4.30.0080.02313.69
5.4.20.0030.04113.89
5.4.10.0000.02113.73
5.4.00.0050.03413.47
5.3.290.0070.04212.59
5.3.280.0070.03612.61
5.3.270.0000.03312.70
5.3.260.0030.02312.69
5.3.250.0030.04012.54
5.3.240.0050.03312.59
5.3.230.0050.03812.68
5.3.220.0040.03912.62
5.3.210.0050.03012.50
5.3.200.0020.04112.54
5.3.190.0030.04412.56
5.3.180.0020.04712.61
5.3.170.0000.04012.76
5.3.160.0030.02912.61
5.3.150.0050.02812.53
5.3.140.0070.03812.72
5.3.130.0050.03012.51
5.3.120.0030.02612.61
5.3.110.0050.03112.59
5.3.100.0010.03112.36
5.3.90.0030.03012.37
5.3.80.0040.02612.33
5.3.70.0030.04012.28
5.3.60.0060.03212.41
5.3.50.0000.04112.15
5.3.40.0020.04112.19
5.3.30.0030.03512.16
5.3.20.0020.04012.16
5.3.10.0050.04012.14
5.3.00.0020.04011.99
5.2.170.0020.01911.28
5.2.160.0010.03511.28
5.2.150.0010.03611.28
5.2.140.0070.02811.28
5.2.130.0050.03011.28
5.2.120.0030.03011.28
5.2.110.0050.02611.28
5.2.100.0040.03311.28
5.2.90.0020.03011.28
5.2.80.0000.02511.28
5.2.70.0080.03011.28
5.2.60.0050.03211.28
5.2.50.0000.03811.28
5.2.40.0050.02811.28
5.2.30.0070.02011.28
5.2.20.0030.03011.28
5.2.10.0050.03011.28
5.2.00.0030.03411.28
5.1.60.0040.02711.28
5.1.50.0030.02811.28
5.1.40.0010.02811.28
5.1.30.0020.03411.28
5.1.20.0030.02711.28
5.1.10.0020.02911.28
5.1.00.0050.02611.28
5.0.50.0090.02011.28
5.0.40.0010.02611.28
5.0.30.0050.02711.28
5.0.20.0020.02511.28
5.0.10.0000.02311.28
5.0.00.0020.03011.28
4.4.90.0020.02011.28
4.4.80.0050.01311.28
4.4.70.0030.02011.28
4.4.60.0070.01511.28
4.4.50.0030.02011.28
4.4.40.0010.02811.28
4.4.30.0030.02011.28
4.4.20.0000.01511.28
4.4.10.0010.02011.28
4.4.00.0000.03011.28
4.3.110.0020.02211.28
4.3.100.0030.01811.28
4.3.90.0050.01711.28
4.3.80.0010.02611.28
4.3.70.0000.02211.28
4.3.60.0030.01811.28
4.3.50.0020.01811.28
4.3.40.0000.02511.28
4.3.30.0010.01311.28
4.3.20.0030.01811.28
4.3.10.0000.01811.28
4.3.00.0020.01811.28

preferences:
41.12 ms | 401 KiB | 5 Q