3v4l.org

run code in 300+ PHP versions simultaneously
<?php class CRYPT { public function encrypt($Str,$Key=ENCKEY) { srand(); $Str=str_pad($Str, 32-strlen($Str)); $IVSize=mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC); $IV=mcrypt_create_iv($IVSize, MCRYPT_RAND); $CryptStr=mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $Key, $Str, MCRYPT_MODE_CBC, $IV); return base64_encode($IV.$CryptStr); } public function decrypt($CryptStr,$Key=ENCKEY) { if ($CryptStr!='') { $IV=substr(base64_decode($CryptStr),0,16); $CryptStr=substr(base64_decode($CryptStr),16); return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $Key, $CryptStr, MCRYPT_MODE_CBC,$IV)); } else { return ''; } } } // class ENCRYPT() $enc = new CRYPT;

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.0090.00616.50
8.3.60.0120.00316.50
8.3.50.0270.00521.87
8.3.40.0080.00818.71
8.3.30.0000.01418.62
8.3.20.0040.00420.33
8.3.10.0080.00023.66
8.3.00.0030.00519.13
8.2.190.0060.01216.58
8.2.180.0090.00618.33
8.2.170.0110.00422.96
8.2.160.0070.00722.14
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0050.00319.65
8.2.110.0090.00019.17
8.2.100.0120.00317.78
8.2.90.0040.00419.05
8.2.80.0080.00017.97
8.2.70.0040.00417.50
8.2.60.0000.00817.91
8.2.50.0000.00818.07
8.2.40.0060.00319.32
8.2.30.0050.00320.58
8.2.20.0030.00617.67
8.2.10.0030.00518.13
8.2.00.0080.00018.09
8.1.280.0170.00725.92
8.1.270.0070.00024.66
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0110.00023.63
8.1.230.0000.01121.03
8.1.220.0030.00617.74
8.1.210.0000.00818.77
8.1.200.0040.00417.25
8.1.190.0050.00317.23
8.1.180.0040.00418.10
8.1.170.0070.00018.87
8.1.160.0070.00021.97
8.1.150.0040.00420.61
8.1.140.0040.00419.56
8.1.130.0000.00717.79
8.1.120.0070.00017.45
8.1.110.0040.00417.40
8.1.100.0000.00817.46
8.1.90.0080.00017.46
8.1.80.0040.00417.41
8.1.70.0050.00217.33
8.1.60.0050.00517.48
8.1.50.0080.00017.43
8.1.40.0030.00617.45
8.1.30.0000.00817.63
8.1.20.0030.00517.63
8.1.10.0050.00217.56
8.1.00.0000.00717.46
8.0.300.0040.00418.77
8.0.290.0000.00716.75
8.0.280.0030.00318.42
8.0.270.0000.00717.24
8.0.260.0000.00717.25
8.0.250.0050.00216.96
8.0.240.0000.00716.78
8.0.230.0030.00316.80
8.0.220.0030.00516.77
8.0.210.0000.00716.75
8.0.200.0000.00716.93
8.0.190.0040.00416.83
8.0.180.0000.00716.91
8.0.170.0040.00416.79
8.0.160.0000.00816.95
8.0.150.0030.00516.94
8.0.140.0040.00416.80
8.0.130.0000.00513.31
8.0.120.0000.00816.86
8.0.110.0040.00416.87
8.0.100.0060.00316.97
8.0.90.0040.00416.75
8.0.80.0120.00316.92
8.0.70.0040.00416.92
8.0.60.0060.00316.75
8.0.50.0040.00416.99
8.0.30.0110.00716.91
8.0.20.0070.01317.40
8.0.10.0000.00816.82
8.0.00.0110.00716.63
7.4.330.0050.00015.08
7.4.320.0000.00716.39
7.4.300.0060.00016.48
7.4.290.0000.00616.63
7.4.280.0050.00216.46
7.4.270.0000.00716.59
7.4.260.0000.00816.54
7.4.250.0000.00816.44
7.4.240.0030.00516.58
7.4.230.0000.00716.66
7.4.220.0110.00716.43
7.4.210.0070.00716.36
7.4.200.0030.00316.58
7.4.160.0190.00316.42
7.4.150.0070.01017.40
7.4.140.0140.02017.86
7.4.130.0100.01016.44
7.4.120.0060.01116.35
7.4.110.0070.01116.42
7.4.100.0100.01316.34
7.4.90.0060.01216.46
7.4.80.0120.00619.39
7.4.70.0180.00516.34
7.4.60.0130.00316.41
7.4.50.0030.00316.47
7.4.40.0100.00716.48
7.4.30.0080.00816.41
7.4.00.0060.01114.92
7.3.330.0050.00013.12
7.3.320.0050.00013.00
7.3.310.0000.00716.17
7.3.300.0040.00416.28
7.3.290.0100.00716.21
7.3.280.0070.00916.21
7.3.270.0150.00617.40
7.3.260.0070.01416.56
7.3.250.0090.00816.43
7.3.240.0050.01716.19
7.3.230.0100.00716.60
7.3.210.0180.00016.34
7.3.200.0070.01116.26
7.3.190.0070.01016.30
7.3.180.0120.00316.54
7.3.170.0060.01016.27
7.3.160.0060.01616.56
7.3.120.0070.01014.99
7.3.110.0060.00914.80
7.3.100.0070.00714.57
7.3.90.0060.01214.74
7.3.80.0030.01314.65
7.3.70.0040.00414.63
7.3.60.0070.00714.79
7.3.50.0040.00714.39
7.3.40.0040.00814.74
7.3.30.0000.01314.65
7.3.20.0030.00816.66
7.3.10.0040.00816.32
7.3.00.0000.01416.23
7.2.330.0120.00916.61
7.2.320.0060.01016.60
7.2.310.0090.01116.30
7.2.300.0090.01216.63
7.2.290.0030.01416.58
7.2.250.0090.00914.80
7.2.240.0040.01614.79
7.2.230.0040.01214.89
7.2.220.0040.01114.70
7.2.210.0060.00314.94
7.2.200.0030.00714.84
7.2.190.0000.01314.91
7.2.180.0030.01214.86
7.2.170.0070.00714.76
7.2.00.0140.00619.20
7.1.330.0040.00815.72
7.1.320.0130.00315.63
7.1.310.0040.01115.37
7.1.300.0050.00315.81
7.1.290.0090.00615.59
7.1.280.0030.00915.70
7.1.270.0030.00615.76
7.1.260.0030.00715.71
7.1.100.0000.00918.01
7.1.70.0000.01116.94
7.1.60.0130.01019.48
7.1.50.0030.01716.81
7.1.00.0100.07022.27
7.0.200.0000.00716.33
7.0.60.0030.05720.07
7.0.50.0070.05717.97
7.0.40.0170.06719.96
7.0.30.0370.06720.26
7.0.20.0230.08020.22
7.0.10.0100.04020.23
7.0.00.0030.09020.20
5.6.280.0000.07721.00
5.6.210.0070.03720.61
5.6.200.0100.07018.18
5.6.190.0070.04020.46
5.6.180.0270.08020.48
5.6.170.0270.08020.45
5.6.160.0100.08020.54
5.6.150.0130.07718.16
5.6.140.0000.05718.17
5.6.130.0100.07718.12
5.6.120.0030.05721.13
5.6.110.0030.04321.12
5.6.100.0100.08721.13
5.6.90.0200.06320.95
5.6.80.0070.07020.49
5.5.350.2930.03720.38
5.5.340.0100.06017.99
5.5.330.0100.07020.35
5.5.320.0300.07020.28
5.5.310.0370.07320.35
5.5.300.0070.06318.08
5.5.290.0030.08317.95
5.5.280.0100.06320.98
5.5.270.0070.08320.79
5.5.260.0100.07720.87
5.5.250.0100.07720.65
5.5.240.0400.06020.08

preferences:
45.57 ms | 401 KiB | 5 Q