3v4l.org

run code in 300+ PHP versions simultaneously
<?php function word_cloud($words, $div_size = 400) { $tags = 0; $cloud = "<div style=\"width: {$div_size}px\">"; /* This word cloud generation algorithm was taken from the Wikipedia page on "word cloud" with some minor modifications to the implementation */ /* Initialize some variables */ $fmax = 96; /* Maximum font size */ $fmin = 8; /* Minimum font size */ $tmin = min($words); /* Frequency lower-bound */ $tmax = max($words); /* Frequency upper-bound */ foreach ($words as $word => $frequency) { if ($frequency > $tmin) { $font_size = floor( ( $fmax * ($frequency - $tmin) ) / ( $tmax - $tmin ) ); /* Define a color index based on the frequency of the word */ $r = $g = 0; $b = floor( 255 * ($frequency / $tmax) ); $color = '#' . sprintf('%02s', dechex($r)) . sprintf('%02s', dechex($g)) . sprintf('%02s', dechex($b)); } else { $font_size = 0; } if ($font_size >= $fmin) { $cloud .= "<span style=\"font-size: {$font_size}px; color: $color;\">$word</span> "; $tags++; } } $cloud .= "</div>"; return array($cloud, $tags); } $words = ['una' => 1, 'dos' => 2, 'qweqwe' => 3]; var_dump(word_cloud($words));

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.0060.01218.68
8.3.60.0120.00618.30
8.3.50.0120.00917.52
8.3.40.0090.00618.66
8.3.30.0140.00418.84
8.3.20.0040.00418.71
8.3.10.0080.00020.34
8.3.00.0030.00517.75
8.2.180.0130.00716.75
8.2.170.0140.00022.96
8.2.160.0070.00722.01
8.2.150.0070.00424.18
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0040.00419.95
8.2.110.0030.00620.61
8.2.100.0000.01117.85
8.2.90.0040.00418.34
8.2.80.0060.00318.05
8.2.70.0030.00617.75
8.2.60.0040.00418.05
8.2.50.0060.00318.07
8.2.40.0000.00718.34
8.2.30.0000.00818.11
8.2.20.0000.00817.79
8.2.10.0040.00417.82
8.2.00.0030.00617.93
8.1.280.0140.00025.92
8.1.270.0060.00323.99
8.1.260.0040.00426.35
8.1.250.0000.00928.09
8.1.240.0030.00622.25
8.1.230.0060.00621.04
8.1.220.0000.00717.89
8.1.210.0000.00818.98
8.1.200.0030.00617.35
8.1.190.0050.00317.51
8.1.180.0080.00018.10
8.1.170.0030.00518.93
8.1.160.0040.00419.02
8.1.150.0080.00018.63
8.1.140.0040.00417.48
8.1.130.0040.00417.88
8.1.120.0020.00517.48
8.1.110.0000.00717.43
8.1.100.0050.00217.45
8.1.90.0050.00317.48
8.1.80.0000.00717.59
8.1.70.0000.00717.42
8.1.60.0000.00917.52
8.1.50.0040.00417.52
8.1.40.0080.00017.49
8.1.30.0000.00917.76
8.1.20.0030.00617.64
8.1.10.0070.00017.47
8.1.00.0040.00417.55
8.0.300.0040.00420.09
8.0.290.0030.00616.75
8.0.280.0070.00018.58
8.0.270.0070.00017.25
8.0.260.0030.00316.90
8.0.250.0040.00417.00
8.0.240.0060.00516.95
8.0.230.0030.00317.00
8.0.220.0020.00516.93
8.0.210.0040.00417.02
8.0.200.0000.00717.08
8.0.190.0050.00217.09
8.0.180.0040.00416.97
8.0.170.0000.00916.89
8.0.160.0050.00216.93
8.0.150.0080.00016.96
8.0.140.0040.00816.97
8.0.130.0000.00513.33
8.0.120.0040.00416.95
8.0.110.0000.00716.94
8.0.100.0070.00316.98
8.0.90.0000.00716.92
8.0.80.0100.01016.94
8.0.70.0000.00716.88
8.0.60.0080.00017.04
8.0.50.0020.00516.95
8.0.30.0080.01117.15
8.0.20.0130.00817.07
8.0.10.0040.00417.21
8.0.00.0120.00816.72
7.4.330.0000.00614.83
7.4.320.0040.00416.59
7.4.300.0060.00016.57
7.4.290.0030.00316.67
7.4.280.0040.00416.73
7.4.270.0030.00316.69
7.4.260.0000.00513.30
7.4.250.0040.00416.59
7.4.240.0070.00016.51
7.4.230.0030.00316.48
7.4.220.0110.00916.63
7.4.210.0090.00916.72
7.4.200.0020.00516.72
7.4.190.0030.00316.76
7.4.160.0060.00916.51
7.4.150.0090.00917.07
7.4.140.0090.00817.29
7.4.130.0080.00916.73
7.4.120.0100.00716.73
7.4.110.0150.00316.65
7.4.100.0150.00816.50
7.4.90.0040.01916.51
7.4.80.0070.01118.80
7.4.70.0090.01216.64
7.4.60.0060.01316.43
7.4.50.0000.00516.56
7.4.40.0030.01022.27
7.4.30.0170.00316.57
7.4.10.0000.01414.89
7.4.00.0020.01414.89
7.3.330.0060.00013.27
7.3.320.0060.00013.36
7.3.310.0070.00016.42
7.3.300.0030.00316.41
7.3.290.0060.00916.38
7.3.280.0090.01016.40
7.3.270.0070.01017.07
7.3.260.0120.00618.24
7.3.250.0130.00916.70
7.3.240.0090.00916.54
7.3.230.0120.00416.49
7.3.210.0070.01016.69
7.3.200.0000.01719.39
7.3.190.0110.01216.46
7.3.180.0100.00516.59
7.3.170.0080.00716.40
7.3.160.0080.00816.67
7.3.130.0060.01314.87
7.3.120.0040.01215.00
7.3.110.0100.00814.98
7.3.100.0030.01014.78
7.3.90.0050.01014.82
7.3.80.0090.00514.81
7.3.70.0090.00914.79
7.3.60.0020.01314.81
7.3.50.0050.01114.65
7.3.40.0080.00814.92
7.3.30.0060.00314.73
7.3.20.0080.00616.66
7.3.10.0070.00816.68
7.3.00.0060.00716.57
7.2.330.0060.01616.73
7.2.320.0060.01816.52
7.2.310.0090.00916.57
7.2.300.0040.01416.83
7.2.290.0120.00416.68
7.2.260.0070.01315.21
7.2.250.0080.00815.15
7.2.240.0080.00815.14
7.2.230.0050.00815.02
7.2.220.0120.00315.14
7.2.210.0070.00815.04
7.2.200.0090.00415.08
7.2.190.0090.00715.02
7.2.180.0060.00714.97
7.2.170.0040.01015.10
7.2.160.0070.00315.13
7.2.150.0050.00516.93
7.2.140.0070.00717.02
7.2.130.0050.00916.78
7.2.120.0030.01216.94
7.2.110.0070.00616.90
7.2.100.0080.00816.90
7.2.90.0060.00816.87
7.2.80.0030.01017.01
7.2.70.0050.00816.91
7.2.60.0090.00716.94
7.2.50.0080.00617.00
7.2.40.0090.00516.95
7.2.30.0030.00917.06
7.2.20.0030.00916.97
7.2.10.0020.01317.01
7.2.00.0070.00717.84
7.1.330.0030.01015.82
7.1.320.0050.00915.73
7.1.310.0050.00915.85
7.1.300.0020.01115.59
7.1.290.0070.00815.71
7.1.280.0040.00815.74
7.1.270.0060.00615.93
7.1.260.0010.01115.69
7.1.250.0070.00715.66
7.1.240.0070.01015.90
7.1.230.0030.01015.89
7.1.220.0000.01016.00
7.1.210.0120.00015.85
7.1.200.0120.00315.93
7.1.190.0030.01015.60
7.1.180.0060.00915.95
7.1.170.0070.00315.94
7.1.160.0070.00315.68
7.1.150.0030.00615.89
7.1.140.0090.00315.91
7.1.130.0060.00915.86
7.1.120.0060.00815.49
7.1.110.0080.00515.85
7.1.100.0420.00516.09
7.1.90.0030.01415.82
7.1.80.0030.00815.59
7.1.70.0060.00416.42
7.1.60.0070.01217.69
7.1.50.0080.00816.35
7.1.40.0040.00415.96
7.1.30.0030.01015.75
7.1.20.0100.00715.45
7.1.10.0030.01415.89
7.1.00.0020.03819.14
7.0.330.0070.00715.43
7.0.320.0040.00715.29
7.0.310.0060.00715.41
7.0.300.0040.00715.55
7.0.290.0000.00915.25
7.0.280.0070.00715.50
7.0.270.0070.00315.42
7.0.260.0030.01015.43
7.0.250.0000.01115.40
7.0.240.0030.00715.34
7.0.230.0080.00415.18
7.0.220.0000.00815.45
7.0.210.0100.00315.40
7.0.200.0030.00615.96
7.0.190.0070.00315.51
7.0.180.0070.00315.56
7.0.170.0000.01515.16
7.0.160.0100.00615.45
7.0.150.0070.00315.45
7.0.140.0050.03918.68
7.0.130.0030.01015.55
7.0.120.0030.00615.44
7.0.110.0030.00615.53
7.0.100.0030.00515.45
7.0.90.0110.00415.51
7.0.80.0070.01015.39
7.0.70.0030.01015.36
7.0.60.0030.04717.80
7.0.50.0080.03716.57
7.0.40.0030.04115.68
7.0.30.0080.03515.63
7.0.20.0070.04715.59
7.0.10.0080.04315.58
7.0.00.0020.03915.65
5.6.400.0040.01114.59
5.6.390.0000.01514.41
5.6.380.0040.01114.15
5.6.370.0060.00914.45
5.6.360.0060.00614.09
5.6.350.0070.00714.25
5.6.340.0030.01014.41
5.6.330.0030.00714.58
5.6.320.0100.00314.30
5.6.310.0030.00714.36
5.6.300.0030.00914.56
5.6.290.0060.00914.39
5.6.280.0030.04217.93
5.6.270.0040.01114.34
5.6.260.0060.00614.35
5.6.250.0120.00314.34
5.6.240.0030.01214.50
5.6.230.0040.01414.23
5.6.220.0040.00414.46
5.6.210.0100.04317.44
5.6.200.0000.03416.39
5.6.190.0000.03916.37
5.6.180.0080.03016.14
5.6.170.0030.04616.32
5.6.160.0100.03316.33
5.6.150.0020.03916.26
5.6.140.0020.02616.21
5.6.130.0050.02816.40
5.6.120.0060.04616.37
5.6.110.0100.02716.16
5.6.100.0080.03916.28
5.6.90.0090.04016.22
5.6.80.0050.04415.89
5.6.70.0090.04315.91
5.6.60.0030.03416.08
5.6.50.0050.04315.94
5.6.40.0100.03915.93
5.6.30.0110.03616.10
5.6.20.0060.04515.90
5.6.10.0050.02416.00
5.6.00.0090.03315.80
5.5.380.0090.00614.45
5.5.370.0070.01114.49
5.5.360.0000.01314.32
5.5.350.0170.04517.23
5.5.340.0020.02716.08
5.5.330.0070.04416.06
5.5.320.0020.04716.22
5.5.310.0030.03716.15
5.5.300.0020.04916.17
5.5.290.0080.02316.19
5.5.280.0130.03816.26
5.5.270.0050.03316.06
5.5.260.0080.04116.21
5.5.250.0050.04516.14
5.5.240.0070.03215.74
5.5.230.0060.02815.78
5.5.220.0080.03115.83
5.5.210.0050.02415.96
5.5.200.0070.03015.79
5.5.190.0050.03615.91
5.5.180.0070.03615.93
5.5.170.0030.01014.17
5.5.160.0030.04515.88
5.5.150.0040.02515.80
5.5.140.0000.04615.77
5.5.130.0060.03415.91
5.5.120.0080.02315.87
5.5.110.0090.03415.87
5.5.100.0020.04715.86
5.5.90.0060.04115.69
5.5.80.0100.03215.65
5.5.70.0060.04515.82
5.5.60.0100.03815.81
5.5.50.0080.04115.66
5.5.40.0070.02415.94
5.5.30.0070.02815.67
5.5.20.0050.04515.74
5.5.10.0070.04315.72
5.5.00.0050.03215.83
5.4.450.0080.02116.00
5.4.440.0030.04716.04
5.4.430.0050.02415.99
5.4.420.0080.04015.98
5.4.410.0070.04015.89
5.4.400.0060.02515.85
5.4.390.0160.03315.85
5.4.380.0070.03015.89
5.4.370.0100.03815.83
5.4.360.0080.03015.82
5.4.350.0070.03515.76
5.4.340.0050.04215.88
5.4.330.0090.00312.63
5.4.320.0030.04015.88
5.4.310.0000.03915.88
5.4.300.0090.03815.84
5.4.290.0080.03915.84
5.4.280.0050.02915.83
5.4.270.0020.03815.87
5.4.260.0030.02815.85
5.4.250.0050.04115.82
5.4.240.0050.04215.83
5.4.230.0060.03015.87
5.4.220.0050.02715.79
5.4.210.0070.03515.84
5.4.200.0050.02515.88
5.4.190.0050.02815.82
5.4.180.0020.04515.79
5.4.170.0030.03515.83
5.4.160.0060.03615.82
5.4.150.0090.04015.80
5.4.140.0060.03814.52
5.4.130.0080.02514.52
5.4.120.0010.02514.53
5.4.110.0060.02514.55
5.4.100.0030.03614.59
5.4.90.0030.03514.61
5.4.80.0070.03214.54
5.4.70.0060.03814.59
5.4.60.0090.03914.49
5.4.50.0040.04014.47
5.4.40.0090.03914.45
5.4.30.0050.03214.51
5.4.20.0120.02014.47
5.4.10.0000.03314.54
5.4.00.0100.02914.18
5.3.290.0000.02613.68
5.3.280.0090.03213.66
5.3.270.0020.02913.63
5.3.260.0070.04013.61
5.3.250.0020.02913.55
5.3.240.0050.03613.62
5.3.230.0070.04313.62
5.3.220.0080.02113.63
5.3.210.0070.03913.63
5.3.200.0030.02313.60
5.3.190.0060.03713.59
5.3.180.0030.04013.65
5.3.170.0070.03613.62
5.3.160.0030.03813.58
5.3.150.0100.03513.62
5.3.140.0040.03313.65
5.3.130.0070.03113.58
5.3.120.0090.02213.59
5.3.110.0090.03913.60
5.3.100.0080.04013.35
5.3.90.0070.03913.31
5.3.80.0040.04513.31
5.3.70.0080.03213.43
5.3.60.0060.03413.33
5.3.50.0050.03313.24
5.3.40.0050.04213.33
5.3.30.0030.03913.28
5.3.20.0070.02313.17
5.3.10.0020.02213.10
5.3.00.0040.04313.15
5.2.170.0070.03011.21
5.2.160.0030.06311.06
5.2.150.0000.07311.20
5.2.140.0100.04711.16
5.2.130.0030.03011.18
5.2.120.0070.03311.14
5.2.110.0000.03311.18
5.2.100.0000.04711.32
5.2.90.0000.05011.16
5.2.80.0070.05711.12
5.2.70.0070.03711.20
5.2.60.0030.05711.08
5.2.50.0070.05310.93
5.2.40.0070.06011.04
5.2.30.0000.04311.03
5.2.20.0070.05010.98
5.2.10.0000.06010.72
5.2.00.0030.05710.77
5.1.60.0000.05310.22
5.1.50.0130.0309.98
5.1.40.0000.05710.03
5.1.30.0100.03710.31
5.1.20.0100.05010.39
5.1.10.0000.05310.03
5.1.00.0000.05010.05
5.0.50.0000.0278.64
5.0.40.0070.0408.47
5.0.30.0100.0438.45
5.0.20.0030.0278.42
5.0.10.0030.0378.42
5.0.00.0070.0608.42
4.4.90.0000.0408.42
4.4.80.0000.0238.42
4.4.70.0070.0278.42
4.4.60.0070.0338.42
4.4.50.0000.0378.42
4.4.40.0000.0438.42
4.4.30.0000.0378.42
4.4.20.0000.0408.42
4.4.10.0030.0208.42
4.4.00.0030.0538.42
4.3.110.0000.0408.42
4.3.100.0000.0208.42
4.3.90.0070.0138.42
4.3.80.0000.0378.42
4.3.70.0070.0178.42
4.3.60.0100.0278.42
4.3.50.0030.0338.42
4.3.40.0030.0508.42
4.3.30.0000.0408.42
4.3.20.0070.0238.42
4.3.10.0030.0378.42
4.3.00.0000.0408.42

preferences:
47.31 ms | 401 KiB | 5 Q