3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Return the coefficient of two items based on Jaccard index * http://en.wikipedia.org/wiki/Jaccard_index * * Example: * * $tags1 = "code, php, jaccard, test, items"; * $tags2 = "test, code"; * echo getSimilarityCoefficient( $tags1, $tags2 ); // 0.28 * * $str1 = "similarity coefficient of two items"; * $str2 = "two items are cool"; * echo getSimilarityCoefficient( $str1, $str2, " " ); // 0.44 * * @param string $item1 * @param string $item2 * @param string $separator * @return float * @author Henrique Hohmann * @version 0.1 */ function getSimilarityCoefficient( $item1, $item2, $separator = "," ) { $item1 = explode( $separator, $item1 ); $item2 = explode( $separator, $item2 ); $arr_intersection = array_intersect( $item2, $item2 ); $arr_union = array_merge( $item1, $item2 ); $coefficient = count( $arr_intersection ) / count( $arr_union ); return $coefficient; } print(getSimilarityCoefficient('SA PRESTASHOP', strtoupper('PrestaShop SA')));

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.0120.00918.18
8.3.50.0130.00921.21
8.3.40.0040.01118.67
8.3.30.0040.01118.97
8.3.20.0030.00520.29
8.3.10.0020.00521.85
8.3.00.0080.00017.38
8.2.180.0150.00016.35
8.2.170.0110.00419.00
8.2.160.0100.00322.96
8.2.150.0000.00724.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0000.00821.00
8.2.110.0030.00620.15
8.2.100.0080.00417.84
8.2.90.0080.00019.09
8.2.80.0040.00417.97
8.2.70.0000.00917.25
8.2.60.0000.00817.80
8.2.50.0000.00918.07
8.2.40.0040.00418.04
8.2.30.0040.00418.07
8.2.20.0040.00417.75
8.2.10.0030.00318.05
8.2.00.0000.00719.72
8.1.280.0070.00725.92
8.1.270.0110.00420.13
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0180.00021.87
8.1.230.0040.00722.66
8.1.220.0000.00917.74
8.1.210.0000.00818.77
8.1.200.0040.00417.22
8.1.190.0030.00517.24
8.1.180.0060.00318.10
8.1.170.0030.00618.55
8.1.160.0080.00022.01
8.1.150.0000.00818.89
8.1.140.0000.00717.52
8.1.130.0030.00317.82
8.1.120.0000.00717.36
8.1.110.0080.00017.46
8.1.100.0000.00717.28
8.1.90.0000.00717.34
8.1.80.0040.00417.52
8.1.70.0000.00717.44
8.1.60.0000.00917.55
8.1.50.0030.00617.51
8.1.40.0040.00417.56
8.1.30.0030.00517.66
8.1.20.0000.00717.59
8.1.10.0050.00317.37
8.1.00.0030.00517.39
8.0.300.0000.00718.77
8.0.290.0030.00616.75
8.0.280.0070.00018.53
8.0.270.0040.00417.26
8.0.260.0040.00417.28
8.0.250.0000.00816.95
8.0.240.0070.00017.00
8.0.230.0070.00016.93
8.0.220.0040.00416.88
8.0.210.0030.00316.77
8.0.200.0030.00316.96
8.0.190.0080.00016.89
8.0.180.0000.00816.82
8.0.170.0000.00716.90
8.0.160.0000.00716.88
8.0.150.0070.00016.91
8.0.140.0040.00416.79
8.0.130.0060.00013.39
8.0.120.0030.00516.88
8.0.110.0070.00016.82
8.0.100.0040.00416.82
8.0.90.0040.00416.82
8.0.80.0110.00816.88
8.0.70.0070.00016.85
8.0.60.0040.00416.71
8.0.50.0000.00816.79
8.0.30.0120.00417.14
8.0.20.0140.00717.40
8.0.10.0000.00716.86
8.0.00.0070.00916.82
7.4.330.0040.00415.03
7.4.320.0060.00016.60
7.4.300.0000.00616.52
7.4.290.0000.00716.44
7.4.280.0050.00216.50
7.4.270.0040.00416.68
7.4.260.0030.00316.50
7.4.250.0040.00416.34
7.4.240.0060.00216.62
7.4.230.0070.00016.45
7.4.220.0060.01216.55
7.4.210.0060.00916.53
7.4.200.0050.00216.61
7.4.160.0090.00616.71
7.4.150.0170.00317.40
7.4.140.0080.01117.86
7.4.130.0070.01116.41
7.4.120.0060.01316.63
7.4.110.0060.01316.64
7.4.100.0030.01616.49
7.4.90.0090.00916.34
7.4.80.0140.00619.39
7.4.70.0120.00516.51
7.4.60.0070.01016.44
7.4.50.0050.00316.18
7.4.40.0000.01616.33
7.4.30.0090.00916.50
7.4.00.0070.01014.97
7.3.330.0030.00513.30
7.3.320.0030.00313.34
7.3.310.0040.00416.35
7.3.300.0030.00316.32
7.3.290.0050.00916.29
7.3.280.0110.00816.34
7.3.270.0120.00617.40
7.3.260.0100.00616.50
7.3.250.0120.00916.47
7.3.240.0100.00716.35
7.3.230.0100.00616.52
7.3.210.0160.00316.41
7.3.200.0120.00319.39
7.3.190.0100.00516.44
7.3.180.0090.00616.46
7.3.170.0030.01416.54
7.3.160.0040.01216.36
7.3.120.0070.01114.88
7.3.110.0040.00814.91
7.3.100.0100.00314.66
7.3.90.0030.01414.98
7.3.80.0110.00314.80
7.3.70.0060.00614.51
7.3.60.0060.00814.74
7.3.50.0120.00314.84
7.3.40.0090.00614.88
7.3.30.0060.00614.88
7.3.20.0040.00416.61
7.3.10.0110.00416.34
7.3.00.0100.00316.74
7.2.330.0070.01116.80
7.2.320.0080.01216.59
7.2.310.0160.00616.61
7.2.300.0050.01216.56
7.2.290.0130.00316.60
7.2.250.0100.01015.02
7.2.240.0070.01014.83
7.2.230.0120.00614.77
7.2.220.0060.00614.69
7.2.210.0070.00715.13
7.2.200.0130.00015.00
7.2.190.0080.00414.74
7.2.180.0000.01314.84
7.2.170.0110.00414.95
7.2.60.0030.00916.93
7.2.00.0040.01119.59
7.1.330.0090.00315.31
7.1.320.0070.00715.59
7.1.310.0030.00915.86
7.1.300.0100.00615.75
7.1.290.0070.00715.52
7.1.280.0080.00415.76
7.1.270.0070.00715.77
7.1.260.0090.00615.64
7.1.200.0060.00615.77
7.1.100.0000.00918.03
7.1.70.0030.00717.03
7.1.60.0070.01819.59
7.1.50.0100.01616.90
7.1.00.0070.07322.54
7.0.200.0040.00416.61
7.0.60.0070.06019.82
7.0.50.0070.07317.88
7.0.40.0030.09020.15
7.0.30.0200.04320.34
7.0.20.0230.05020.19
7.0.10.0000.04720.05
7.0.00.0100.05320.09
5.6.280.0030.07321.00
5.6.210.0130.08020.70
5.6.200.0100.07718.22
5.6.190.0030.04320.57
5.6.180.0200.04720.50
5.6.170.0230.04720.53
5.6.160.0070.08020.50
5.6.150.0070.07318.29
5.6.140.0030.04318.14
5.6.130.0100.04718.18
5.6.120.0170.07321.12
5.6.110.0030.06720.99
5.6.100.0070.08020.94
5.6.90.0200.07021.02
5.6.80.0070.05020.52
5.5.350.0400.07320.41
5.5.340.0130.07317.98
5.5.330.0000.04720.42
5.5.320.0070.06720.21
5.5.310.0330.07020.51
5.5.300.0030.09018.02
5.5.290.0030.04317.94
5.5.280.0030.08720.74
5.5.270.0130.07320.94
5.5.260.0030.04020.87
5.5.250.0030.04020.58
5.5.240.0030.07720.34
5.4.450.0100.06319.61
5.4.440.0300.05719.43
5.4.430.0200.05019.23
5.4.420.0170.05319.48
5.4.410.0230.05019.08
5.4.400.0200.05018.89
5.4.390.0200.05319.18
5.4.380.0230.05019.13
5.4.370.0100.05719.07
5.4.360.0070.05719.30
5.4.350.0070.05718.96
5.4.340.0400.05319.30
5.4.320.0700.05018.99
5.4.310.0630.05719.15
5.4.300.0630.05019.21
5.4.290.0670.04719.19
5.4.280.0770.04718.88
5.4.270.0570.05719.21
5.4.260.0600.05019.30
5.4.250.0730.04319.33
5.4.240.0670.05718.98
5.4.230.0600.06018.88
5.4.220.0700.05319.22
5.4.210.0670.04719.20
5.4.200.0670.05716.73
5.4.190.0600.06719.11
5.4.180.0530.06019.19
5.4.170.0730.05019.15
5.4.160.0670.04319.04
5.4.150.0700.05718.97
5.4.140.0600.05016.64
5.4.130.0630.04716.50
5.4.120.0570.05316.29
5.4.110.0670.04316.52
5.4.100.0600.05016.68
5.4.90.0870.04016.55
5.4.80.0630.05016.66
5.4.70.0570.05316.30
5.4.60.0700.04716.25
5.4.50.0530.04716.49
5.4.40.0530.05016.22
5.4.30.0530.05016.59
5.4.20.0600.05316.59
5.4.10.0530.05316.63
5.4.00.0530.05716.13
5.3.290.0600.05314.55
5.3.280.0700.04714.45
5.3.270.0670.06014.77
5.3.260.0730.04314.73
5.3.250.0770.04714.75
5.3.240.0570.05314.56
5.3.230.0670.05714.62
5.3.220.0770.05714.61
5.3.210.0570.06014.48
5.3.200.0670.04714.48
5.3.190.0730.06714.63
5.3.180.0670.04714.57
5.3.170.0570.05314.46
5.3.160.0670.05014.47
5.3.150.0800.04714.72
5.3.140.0670.04714.53
5.3.130.0700.04714.46
5.3.120.0730.04314.50
5.3.110.0670.05314.69
5.3.100.0630.05013.94
5.3.90.0630.04713.92
5.3.80.0800.06314.03
5.3.70.0730.04314.03
5.3.60.0630.04714.01
5.3.50.0830.04313.95
5.3.40.0470.06014.00
5.3.30.0670.04713.91
5.3.20.0830.04313.59
5.3.10.0670.04313.82
5.3.00.0730.03313.65
5.2.170.0700.04011.09
5.2.160.0570.03711.20
5.2.150.0500.04011.15
5.2.140.0500.04711.14
5.2.130.0500.03711.02
5.2.120.0370.04311.08
5.2.110.0430.04711.00
5.2.100.0670.03311.16
5.2.90.0500.04011.00
5.2.80.0400.04711.21
5.2.70.0470.04311.10
5.2.60.0400.06311.21
5.2.50.0570.04010.99
5.2.40.0430.04710.91
5.2.30.0030.04310.86
5.2.20.0100.04310.99
5.2.10.0070.04010.78
5.2.00.0100.03710.70
5.1.60.0100.0309.93
5.1.50.0300.0379.89
5.1.40.0370.0379.91
5.1.30.0300.04010.27
5.1.20.0330.03710.38
5.1.10.0430.0309.99
5.1.00.0470.04010.21
5.0.50.0200.0308.47
5.0.40.0200.0308.33
5.0.30.0170.0478.33
5.0.20.0170.0338.18
5.0.10.0370.0278.33
5.0.00.0170.0438.27
4.4.90.0230.0175.79
4.4.80.0170.0235.88
4.4.70.0170.0235.84
4.4.60.0170.0305.85
4.4.50.0200.0235.75
4.4.40.0270.0305.79
4.4.30.0170.0235.77
4.4.20.0270.0235.80
4.4.10.0230.0175.80
4.4.00.0170.0335.93
4.3.110.0130.0275.84
4.3.100.0300.0205.82
4.3.90.0270.0275.65
4.3.80.0230.0405.77
4.3.70.0230.0175.65
4.3.60.0200.0235.77
4.3.50.0330.0235.81
4.3.40.0170.0335.70
4.3.30.0130.0174.45
4.3.20.0070.0234.39
4.3.10.0130.0204.36
4.3.00.0000.0236.84

preferences:
64.63 ms | 401 KiB | 5 Q