3v4l.org

run code in 300+ PHP versions simultaneously
<?php function hasher($info, $encdata = false) { $strength = "08"; //if encrypted data is passed, check it against input ($info) if ($encdata) { if (substr($encdata, 0, 60) == crypt($info, "$2a$".$strength."$".substr($encdata, 60))) { return true; } else { return false; } } else { //make a salt and hash it with input, and add salt to end $salt = ""; for ($i = 0; $i < 22; $i++) { $salt .= substr("./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", mt_rand(0, 63), 1); } //return 82 char string (60 char hash & 22 char salt) return crypt($info, "$2a$".$strength."$".$salt).$salt; } } if ('$2a$08$EtdOmTznraimrGNl0uZiPecrPugD5HeOc4yAGd.Kx/gx2vmCUmC7SEtdOmTznraimrGNl0uZiPl' == hasher('tylko', '$2a$08$EtdOmTznraimrGNl0uZiPecrPugD5HeOc4yAGd.Kx/gx2vmCUmC7SEtdOmTznraimrGNl0uZiPl')) { echo 'sss'; }

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.3.120.0030.02814.97
7.3.110.0110.01814.76
7.3.100.0030.02415.00
7.3.90.0060.02014.69
7.3.80.0100.02214.93
7.3.70.0030.02714.95
7.3.60.0040.02514.89
7.3.50.0040.02514.86
7.3.40.0070.02214.82
7.3.30.0070.01714.79
7.3.20.0000.02816.40
7.3.10.0030.02616.49
7.3.00.0100.02016.83
7.2.240.0060.02615.36
7.2.230.0030.02815.10
7.2.220.0030.02914.80
7.2.210.0070.02114.93
7.2.200.0030.03115.16
7.2.190.0030.02714.84
7.2.180.0000.03315.14
7.2.170.0110.01814.76
7.2.160.0060.02215.04
7.2.150.0060.02216.59
7.2.140.0040.02516.88
7.2.130.0100.02016.78
7.2.120.0030.02416.87
7.2.110.0060.02116.97
7.2.100.0030.02617.00
7.2.90.0030.02416.92
7.2.80.0070.02416.78
7.2.70.0030.03016.97
7.2.60.0070.02616.92
7.2.50.0040.02516.66
7.2.40.0030.02716.72
7.2.30.0070.02116.72
7.2.20.0030.02416.58
7.2.10.0000.02916.84
7.2.00.0030.02618.05
7.1.330.0070.02315.75
7.1.320.0030.02315.72
7.1.310.0070.02315.68
7.1.300.0030.02715.75
7.1.290.0100.02015.57
7.1.280.0030.02415.77
7.1.270.0100.02015.63
7.1.260.0100.02115.68
7.1.250.0000.03015.79
7.1.70.0030.02017.12
7.1.60.0190.03619.40
7.1.50.0000.04816.86
7.1.00.0030.05022.45
7.0.200.0030.02016.80
7.0.140.0070.09722.10
7.0.120.0000.09722.03
7.0.60.0000.06720.11
7.0.50.0000.06017.96
7.0.40.0000.11320.23
7.0.30.0330.09720.30
7.0.20.0370.08320.07
7.0.10.0100.08320.07
7.0.00.0030.05720.11
5.6.210.0300.08020.75
5.6.200.0100.06018.20
5.6.190.0170.06320.77
5.6.180.0370.06320.67
5.6.170.0230.05320.48
5.6.160.0130.09020.57
5.6.150.0030.10018.22
5.6.140.0070.10718.25
5.6.130.0070.11018.18
5.6.120.0100.09021.12
5.6.110.0130.07321.05
5.6.100.0100.09721.01
5.6.90.0100.07020.95
5.6.80.0130.07020.41
5.5.350.0130.10720.50
5.5.340.0070.08017.96
5.5.330.0030.10020.37
5.5.320.0030.05320.38
5.5.310.0270.10720.37
5.5.300.0100.10017.97
5.5.290.0100.07018.04
5.5.280.0130.04720.78
5.5.270.0100.09020.87
5.5.260.0070.09320.84
5.5.250.0200.08320.57
5.5.240.0130.10320.22
5.4.450.3530.05719.48
5.4.440.3600.06019.49
5.4.430.3600.06019.31
5.4.420.3370.05719.54
5.4.410.3630.05719.51
5.4.400.3700.05019.06
5.4.390.3430.05318.85
5.4.380.3430.04318.87
5.4.370.3670.05019.25
5.4.360.3030.05019.31
5.4.350.3470.05719.09
5.4.340.3470.05319.14
5.4.320.3570.05018.87
5.4.310.3070.05319.05
5.4.300.3670.05019.24
5.4.290.3800.05319.03
5.4.280.3700.05318.94
5.4.270.3800.06019.14
5.4.260.3630.05018.94
5.4.250.3700.05718.94
5.4.240.3400.05318.98
5.4.230.3470.04318.84
5.4.220.3670.05718.90
5.4.210.3970.05318.86
5.4.200.4170.04719.07
5.4.190.4130.05019.30
5.4.180.3970.04719.08
5.4.170.3630.04719.21
5.4.160.3470.05019.15
5.4.150.3870.05319.12
5.4.140.3570.05016.36
5.4.130.3830.04716.35
5.4.120.3670.05316.30
5.4.110.3670.04716.46
5.4.100.4370.05016.39
5.4.90.3770.05016.42
5.4.80.3500.05316.24
5.4.70.3430.05016.57
5.4.60.3600.05016.52
5.4.50.3670.04716.52
5.4.40.3470.05016.55
5.4.30.3670.05316.33
5.4.20.3330.06016.43
5.4.10.3430.05716.56
5.4.00.3470.04715.76
5.3.290.3900.06314.57
5.3.280.3970.05714.51
5.3.270.3200.06014.58
5.3.260.4000.06014.62
5.3.250.3170.05314.82
5.3.240.4500.07314.51
5.3.230.4330.05714.60
5.3.220.3400.05014.65
5.3.210.3900.05314.48
5.3.200.3770.05714.49
5.3.190.3630.05014.64
5.3.180.3400.05314.47
5.3.170.3700.05014.64
5.3.160.3530.04314.56
5.3.150.3530.06014.64
5.3.140.3730.05014.78
5.3.130.3600.05014.77
5.3.120.3770.05314.77
5.3.110.3600.05714.55
5.3.100.3730.05014.13
5.3.90.3430.05313.93
5.3.80.4200.06014.07
5.3.70.3930.05314.24
5.3.60.4030.05314.09
5.3.50.3330.05713.95
5.3.40.3430.05014.08
5.3.30.3730.05313.83
5.3.20.3570.04713.61
5.3.10.0000.09313.66
5.3.00.4030.05013.80
5.2.170.2970.03311.13
5.2.160.3100.03311.25
5.2.150.2870.03010.95
5.2.140.3100.04010.99
5.2.130.0000.03311.03
5.2.120.0100.05711.07
5.2.110.0000.04010.98
5.2.100.2730.03311.00
5.2.90.3270.03010.95
5.2.80.2830.03011.14
5.2.70.3100.03711.11
5.2.60.2870.03010.96
5.2.50.3270.03011.04
5.2.40.2870.03311.01
5.2.30.2600.03310.81
5.2.20.2770.03010.93
5.2.10.2170.03310.94
5.2.00.2600.02010.66
5.1.60.2430.02010.08
5.1.50.2230.0239.90
5.1.40.2900.0309.94
5.1.30.2800.03010.24
5.1.20.2930.01710.57
5.1.10.2700.02710.15
5.1.00.2470.02710.00
5.0.50.0670.0238.78
5.0.40.0030.0278.29
5.0.30.0000.0508.14
5.0.20.0000.0238.14
5.0.10.0000.0438.16
5.0.00.0100.0638.14
4.4.90.1370.0176.16
4.4.80.1270.0176.16
4.4.70.1400.0176.16
4.4.60.1330.0176.16
4.4.50.1430.0206.16
4.4.40.1130.0236.16
4.4.30.1170.0176.16
4.4.20.1430.0136.16
4.4.10.1200.0176.16
4.4.00.0000.0476.16
4.3.110.0030.0206.16
4.3.100.0070.0306.16
4.3.90.0030.0176.16
4.3.80.0000.0306.16
4.3.70.1700.0136.16
4.3.60.1130.0136.16
4.3.50.1100.0176.16
4.3.40.1370.0236.16
4.3.30.0900.0236.16
4.3.20.0900.0276.16
4.3.10.0870.0206.16
4.3.00.0870.0236.16

preferences:
37.71 ms | 400 KiB | 5 Q