3v4l.org

run code in 300+ PHP versions simultaneously
<?php function usercolor( $username ) { $range = 192 - 64; $factor = $range / 256; $offset = 64; $base_hash = substr(md5($username), 0, 6); $b_R = hexdec(substr($base_hash,0,2)); $b_G = hexdec(substr($base_hash,2,2)); $b_B = hexdec(substr($base_hash,4,2)); $f_R = floor((floor($b_R * $factor) + $offset) / 16) * COL_STEP; $f_G = floor((floor($b_G * $factor) + $offset) / 16) * COL_STEP; $f_B = floor((floor($b_B * $factor) + $offset) / 16) * COL_STEP; return printf('#%02x%02x%02x', $f_R, $f_G, $f_B); } for( $i=0; $i<30; $i++ ) { printf('<div style="height: 100px; width: 100px; background-color: %s">&nbsp;</div>'."\n", usercolor(rand())); }

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)
7.1.70.0000.00817.09
7.1.60.0040.02119.82
7.1.50.0150.00716.99
7.1.00.0030.07722.32
7.0.200.0660.00714.79
7.0.140.0070.06722.09
7.0.60.0030.04320.07
7.0.50.0070.08717.87
7.0.40.0170.07320.09
7.0.30.0170.04720.25
7.0.20.0230.08020.16
7.0.10.0030.05720.23
7.0.00.0170.06720.26
5.6.280.0130.06720.91
5.6.210.0070.08720.48
5.6.200.0000.08018.13
5.6.190.0000.04320.48
5.6.180.0430.07320.52
5.6.170.0270.06020.56
5.6.160.0100.06320.50
5.6.150.0030.04318.29
5.6.140.0030.05318.21
5.6.130.0170.07718.18
5.6.120.0030.04320.94
5.6.110.0130.09021.02
5.6.100.0000.09021.04
5.6.90.0070.06021.09
5.6.80.0100.07320.45
5.5.350.0130.08020.54
5.5.340.0130.06317.99
5.5.330.0000.04320.19
5.5.320.0530.03720.29
5.5.310.0230.04320.27
5.5.300.0100.07018.08
5.5.290.0100.04717.96
5.5.280.0130.04720.90
5.5.270.0130.08020.74
5.5.260.0130.06720.90
5.5.250.0030.04320.70
5.5.240.0170.08320.19
5.4.450.0170.08019.49
5.4.440.0170.08019.41
5.4.430.0130.04019.31
5.4.420.0230.07719.64
5.4.410.0270.04719.36
5.4.400.0130.05719.22
5.4.390.0230.07319.22
5.4.380.0230.03319.22
5.4.370.0300.06018.96
5.4.360.0200.05019.10
5.4.350.0270.06719.18
5.4.340.0270.07019.18
5.4.320.0270.07318.95
5.4.310.0170.04318.87
5.4.300.0130.04019.31
5.4.290.0330.03318.99
5.4.280.0300.06319.22
5.4.270.0270.07019.08
5.4.260.0170.05719.14
5.4.250.0230.07719.22
5.4.240.0230.05019.21
5.4.230.0170.04719.16
5.4.220.0230.07718.98
5.4.210.0300.07019.09
5.4.200.0200.06318.98
5.4.190.0330.04019.14
5.4.180.0130.04019.23
5.4.170.0270.07318.86
5.4.160.0200.07719.16
5.4.150.0370.04019.20
5.4.140.0230.06016.41
5.4.130.0270.04316.35
5.4.120.0200.07016.50
5.4.110.0300.05316.58
5.4.100.0270.05316.38
5.4.90.0270.06016.62
5.4.80.0270.04716.44
5.4.70.0270.06716.34
5.4.60.0230.07016.54
5.4.50.0200.03716.43
5.4.40.0230.05016.42
5.4.30.0170.07716.53
5.4.20.0200.04716.48
5.4.10.0270.05316.48
5.4.00.0200.06015.83
5.3.290.0270.07314.57
5.3.280.0270.07314.76
5.3.270.0300.04714.59
5.3.260.0200.07014.52
5.3.250.0270.07014.69
5.3.240.0230.07314.54
5.3.230.0270.07014.62
5.3.220.0300.06314.54
5.3.210.0270.04714.66
5.3.200.0230.06714.49
5.3.190.0230.06714.66
5.3.180.0300.04014.62
5.3.170.0230.06714.54
5.3.160.0270.07014.57
5.3.150.0300.06714.57
5.3.140.0230.07014.59
5.3.130.0230.07714.55
5.3.120.0300.07014.63
5.3.110.0200.07314.57
5.3.100.0230.06714.05
5.3.90.0230.07014.04
5.3.80.0300.06714.00
5.3.70.0270.04014.04
5.3.60.0270.06714.00
5.3.50.0230.07014.00
5.3.40.0200.03314.00
5.3.30.0300.03014.14
5.3.20.0230.05714.00
5.3.10.0300.06714.00
5.3.00.0230.04714.00
5.2.170.0200.02714.00
5.2.160.0270.02714.00
5.2.150.0200.05714.00
5.2.140.0200.06014.00
5.2.130.0200.03314.00
5.2.120.0100.05314.00
5.2.110.0130.04314.00
5.2.100.0230.05014.00
5.2.90.0200.05314.00
5.2.80.0170.06314.00
5.2.70.0100.06714.00
5.2.60.0200.05014.00
5.2.50.0070.03714.00
5.2.40.0170.04314.00
5.2.30.0070.04014.00
5.2.20.0170.03714.00
5.2.10.0230.05014.00
5.2.00.0200.03714.00
5.1.60.0130.04314.00
5.1.50.0100.03714.00
5.1.40.0230.02314.00
5.1.30.0200.05014.00
5.1.20.0130.05714.00
5.1.10.0200.05014.00
5.1.00.0230.04314.00
5.0.50.0070.03714.00
5.0.40.0130.04014.00
5.0.30.0170.04714.00
5.0.20.0100.02014.00
5.0.10.0030.03014.00
5.0.00.0000.03314.00
4.4.90.0030.03014.00
4.4.80.0130.03314.00
4.4.70.0100.01314.00
4.4.60.0100.02014.00
4.4.50.0070.04014.00
4.4.40.0070.04314.00
4.4.30.0070.04014.00
4.4.20.0070.03714.00
4.4.10.0100.03314.00
4.4.00.0070.03714.00
4.3.110.0100.03714.00
4.3.100.0070.02714.00
4.3.90.0030.01714.00
4.3.80.0000.02714.00
4.3.70.0030.01714.00
4.3.60.0030.01714.00
4.3.50.0070.01314.00
4.3.40.0000.02714.00
4.3.30.0030.01714.00
4.3.20.0030.01314.00
4.3.10.0030.01314.00
4.3.00.0030.01714.00

preferences:
35.19 ms | 401 KiB | 5 Q