3v4l.org

run code in 300+ PHP versions simultaneously
<?php generate(); // FUNCTION function generate() { $digilist = "0123456789ABCDEFGHJKLMNPQRTUVWXY"; //now we generate a new random ID number using the substrings of the digitList string above for( $i = 0; $i < 100; $i++) { $three_chars = NULL; $three_chars .= substr( $digilist, rand( 1, 9 ), 1 ); $three_chars .= substr( $digilist, rand( 10, 31 ), 1 ); $three_chars .= substr( $digilist, rand( 10, 31 ), 1 ); if ($i < 10) { $three_chars .= '0'; $three_chars .= $i; } else { $three_chars .= $i; } $id = $three_chars; $key = get_key( $id ); echo $id . ":" . $key . "\n"; } } function get_key( $id ) { $digilist = "0123456789ABCDEFGHJKLMNPQRTUVWXY"; //ok so now we need to generate an MD5 hash of our ID $hash = md5($id); //cycle through the hash 16 (length of key) times (in steps of 2 because each hex bytes is 2 digits long) $i = 0; $key = NULL; for ($i; $i < 32; $i+=2) { //here we convert the next hex value to an integer and perform a bitwise AND operation against '31' //31 is the highest substring value in our digit list. $nextdigit = hexdec(substr($hash, $i, 2)) & 31; //if 'i' is divisable by 8 (every 4 cycles) then we want to add "-" if ((($i % 8) == 0) && ($i > 0)) { $key .= "-".substr($digilist, $nextdigit, 1); } else { $key .= substr($digilist, $nextdigit, 1); } } return $key; }

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.4.60.0180.01516.61
7.4.50.0100.01116.52
7.4.40.0110.01016.41
7.4.30.0110.01016.41
7.4.20.0100.01116.41
7.4.10.0110.01016.24
7.4.00.0100.00916.04
7.3.180.0220.00916.61
7.3.170.0130.00816.46
7.3.160.0120.01016.44
7.3.150.0110.01016.39
7.3.140.0120.01116.42
7.3.130.0110.00916.28
7.3.120.0110.00915.92
7.3.110.0120.00815.76
7.3.100.0110.00915.33
7.3.90.0100.01015.14
7.3.80.0100.00914.88
7.3.70.0090.00814.79
7.3.60.0090.00914.78
7.3.50.0090.00914.76
7.3.40.0090.00914.76
7.3.30.0090.00914.78
7.3.20.0160.00915.24
7.3.10.0160.00815.25
7.3.00.0150.00915.25
7.2.310.0120.01916.77
7.2.300.0150.01516.80
7.2.290.0110.01216.59
7.2.280.0130.01016.59
7.2.270.0120.01116.62
7.2.260.0110.01116.50
7.2.250.0100.01016.22
7.2.240.0100.01016.02
7.2.230.0100.01015.58
7.2.220.0100.01015.34
7.2.210.0090.01015.08
7.2.200.0100.00915.03
7.2.190.0090.01015.00
7.2.180.0090.01015.01
7.2.170.0100.00915.01
7.2.160.0090.01015.02
7.2.150.0150.00915.51
7.2.140.0150.00915.51
7.2.130.0150.00915.51
7.2.120.0150.00915.50
7.2.110.0140.00915.53
7.2.100.0150.00915.52
7.2.90.0140.00915.55
7.2.80.0140.01015.55
7.2.70.0140.00915.54
7.2.60.0140.00915.54
7.2.50.0170.00915.55
7.2.40.0150.00915.55
7.2.30.0140.00915.57
7.2.20.0160.00915.53
7.2.10.0160.00915.52
7.2.00.0150.00915.55
7.1.330.0150.01014.99
7.1.320.0150.01014.51
7.1.310.0160.00914.45
7.1.300.0160.00914.35
7.1.290.0140.00914.35
7.1.280.0140.00914.36
7.1.270.0150.00914.35
7.1.260.0140.00914.38
7.1.250.0130.00914.40
7.1.240.0150.01015.31
7.1.230.0140.01015.28
7.1.220.0150.00915.26
7.1.210.0150.01115.31
7.1.200.0160.01015.29
7.1.190.0160.01015.28
7.1.180.0140.01115.27
7.1.170.0150.01015.31
7.1.160.0130.01115.29
7.1.150.0140.01015.34
7.1.140.0140.01015.33
7.1.130.0120.01115.30
7.1.120.0130.01015.31
7.1.110.0130.01015.33
7.1.100.0140.01015.32
7.1.90.0150.01015.33
7.1.80.0130.01115.37
7.1.70.0120.01215.35
7.1.60.0160.01015.34
7.1.50.0130.01115.36
7.1.40.0160.01115.35
7.1.30.0140.01015.34
7.1.20.0150.01015.30
7.1.10.0140.00915.33
7.1.00.0130.01115.32
7.0.330.0170.01215.11
7.0.320.0180.00715.25
7.0.310.0180.00815.24
7.0.300.0150.00915.29
7.0.290.0170.00915.22
7.0.280.0120.01015.26
7.0.270.0140.01015.14
7.0.260.0120.00915.24
7.0.250.0130.01315.29
7.0.240.0120.01115.22
7.0.230.0130.01115.32
7.0.220.0140.00915.21
7.0.210.0150.00815.23
7.0.200.0140.01015.20
7.0.190.0140.00915.26
7.0.180.0130.01015.16
7.0.170.0150.01215.25
7.0.160.0120.01015.28
7.0.150.0150.01015.26
7.0.140.0170.01015.19
7.0.130.0160.00915.21
7.0.120.0110.01415.21
7.0.110.0150.01015.29
7.0.100.0140.00815.24
7.0.90.0120.01115.25
7.0.80.0150.01015.28
7.0.70.0140.01215.27
7.0.60.0120.01115.23
7.0.50.0110.01315.29
7.0.40.0170.01115.15
7.0.30.0100.01315.15
7.0.20.0190.00915.18
7.0.10.0120.01315.15
7.0.00.0150.00915.16
5.6.400.0170.01115.83
5.6.390.0140.01215.71
5.6.380.0140.01215.75
5.6.370.0130.01415.80
5.6.360.0150.01515.71
5.6.350.0130.01315.81
5.6.340.0160.01215.80
5.6.330.0160.01515.71
5.6.320.0190.01015.83
5.6.310.0120.01415.83
5.6.300.0140.01415.85
5.6.290.0130.01315.72
5.6.280.0140.01315.84
5.6.270.0160.01115.75
5.6.260.0150.01215.81
5.6.250.0150.01415.78
5.6.240.0130.01315.74
5.6.230.0130.01515.74
5.6.220.0110.01715.83
5.6.210.0170.01115.79
5.6.200.0150.01415.81
5.6.190.0150.01215.76
5.6.180.0160.00915.74
5.6.170.0150.01215.66
5.6.160.0160.01015.73
5.6.150.0160.01115.77
5.6.140.0140.01215.77
5.6.130.0150.01115.75
5.6.120.0140.01315.84
5.6.110.0140.01115.85
5.6.100.0120.01515.74
5.6.90.0120.01415.75
5.6.80.0110.01715.66
5.6.70.0130.01215.71
5.6.60.0130.01415.79
5.6.50.0120.01215.78
5.6.40.0140.01215.74
5.6.30.0130.01415.75
5.6.20.0130.01315.64
5.6.10.0120.01515.77
5.6.00.0160.01515.82
5.5.380.0120.01415.68
5.5.370.0180.01015.76
5.5.360.0170.01015.80
5.5.350.0160.01115.71
5.5.340.0150.01315.78
5.5.330.0160.01215.67
5.5.320.0100.01415.75
5.5.310.0150.01315.77
5.5.300.0160.01015.75
5.5.290.0130.01215.74
5.5.280.0130.01315.81
5.5.270.0150.01015.71
5.5.260.0150.01215.73
5.5.250.0150.01115.79
5.5.240.0150.01215.69
5.5.230.0150.01215.73
5.5.220.0120.01515.68
5.5.210.0140.01215.77
5.5.200.0140.01215.69
5.5.190.0130.01115.78
5.5.180.0180.01015.72
5.5.170.0130.01615.62
5.5.160.0170.01215.70
5.5.150.0160.01415.77
5.5.140.0130.01315.75
5.5.130.0130.01215.77
5.5.120.0150.01415.85
5.5.110.0140.01315.62
5.5.100.0130.01315.71
5.5.90.0160.01515.68
5.5.80.0150.01315.79
5.5.70.0140.01315.68
5.5.60.0190.01015.68
5.5.50.0130.01415.72
5.5.40.0140.01215.78
5.5.30.0160.01215.65
5.5.20.0140.01415.76
5.5.10.0130.01515.61
5.5.00.0150.01315.73
5.4.450.0110.00813.26
5.4.440.0120.00813.29
5.4.430.0130.00813.28
5.4.420.0130.00813.19
5.4.410.0100.01013.24
5.4.400.0090.01113.24
5.4.390.0100.00913.19
5.4.380.0110.00813.26
5.4.370.0110.00813.30
5.4.360.0100.00913.34
5.4.350.0060.01213.19
5.4.340.0110.01113.22
5.4.330.0100.01213.28
5.4.320.0130.00813.19
5.4.310.0100.01013.27
5.4.300.0110.01013.28
5.4.290.0110.01113.28
5.4.280.0110.01213.19
5.4.270.0120.00913.26
5.4.260.0090.01213.21
5.4.250.0140.00913.25
5.4.240.0150.00913.20
5.4.230.0140.01113.19
5.4.220.0120.01213.26
5.4.210.0100.01313.20
5.4.200.0130.00913.26
5.4.190.0140.00713.28
5.4.180.0110.01113.30
5.4.170.0120.01113.18
5.4.160.0120.01113.18
5.4.150.0120.01313.20
5.4.140.0090.01313.32
5.4.130.0110.01013.27
5.4.120.0080.01213.21
5.4.110.0120.01113.25
5.4.100.0100.01113.32
5.4.90.0090.01113.24
5.4.80.0120.01013.34
5.4.70.0110.01013.24
5.4.60.0150.00613.26
5.4.50.0100.01113.26
5.4.40.0120.00913.34
5.4.30.0110.01013.34
5.4.20.0120.00813.29
5.4.10.0150.00813.26
5.4.00.0090.01213.23
5.3.290.0110.01413.64
5.3.280.0140.01013.54
5.3.270.0110.01213.56
5.3.260.0120.01113.62
5.3.250.0110.01313.60
5.3.240.0120.01213.46
5.3.230.0080.01413.54
5.3.220.0110.01213.46
5.3.210.0120.01013.44
5.3.200.0080.01313.44
5.3.190.0130.01113.48
5.3.180.0080.01413.56
5.3.170.0120.01313.60
5.3.160.0100.01213.60
5.3.150.0140.01113.63
5.3.140.0110.01113.55
5.3.130.0130.01313.55
5.3.120.0130.01213.55
5.3.110.0130.01013.55
5.3.100.0080.01413.58
5.3.90.0130.00913.60
5.3.80.0110.01213.45
5.3.70.0120.01013.52
5.3.60.0120.01113.54
5.3.50.0120.00913.45
5.3.40.0100.01213.48
5.3.30.0080.01413.55
5.3.20.0110.01213.52
5.3.10.0120.01013.38
5.3.00.0120.00913.41
5.2.170.0110.01012.80
5.2.160.0110.01112.84
5.2.150.0090.01112.78
5.2.140.0100.01212.78
5.2.130.0110.01112.72
5.2.120.0110.01012.78
5.2.110.0090.01212.77
5.2.100.0090.01112.78
5.2.90.0090.01212.77
5.2.80.0080.01312.75
5.2.70.0090.01212.73
5.2.60.0080.01212.64
5.2.50.0110.01012.68
5.2.40.0100.01212.71
5.2.30.0100.01012.68
5.2.20.0090.01212.65
5.2.10.0080.01212.58
5.2.00.0120.01012.56
5.1.60.0110.00912.49
5.1.50.0090.01312.49
5.1.40.0080.01012.49
5.1.30.0080.01112.49
5.1.20.0100.01012.49
5.1.10.0060.01212.49
5.1.00.0110.00912.49
5.0.50.0090.01112.49
5.0.40.0090.01112.49
5.0.30.0080.01112.49
5.0.20.0090.01112.49
5.0.10.0050.01412.49
5.0.00.0070.01212.49
4.4.90.0040.01212.49
4.4.80.0060.00812.49
4.4.70.0060.00712.49
4.4.60.0070.00812.49
4.4.50.0050.00812.49
4.4.40.0050.01012.49
4.4.30.0070.00812.49
4.4.20.0050.01212.49
4.4.10.0060.00812.49
4.4.00.0060.00812.49
4.3.110.0030.01112.49
4.3.100.0070.00812.49
4.3.90.0060.00912.49
4.3.80.0080.01112.49
4.3.70.0050.00912.49
4.3.60.0050.00912.49
4.3.50.0060.01012.49
4.3.40.0040.00912.49
4.3.30.0060.00612.49
4.3.20.0050.00912.49
4.3.10.0050.00812.49
4.3.00.0040.01012.49

preferences:
38.18 ms | 401 KiB | 5 Q