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; $s = "test"; //$s = "FGykgbMFQiTpVIRhO9HWL/wXYevfsd7ozE99pbDWge/2Fs8fQb1iqeaw3yAe+kLsmTgPUz7mo/sTfEsvEfldWEx9XU51gsM6T1othRV6rshB9ThE3BOOUKKnhqt/gYyUP6POu5HSr7Rem7TIJIEAPh4w1cTQNN2ZCXyYS4Y+C/8="; $test = $enc->encrypt($s, "w+2#)1FP&LIPTL2<8I2"); echo $test; //echo $enc->decrypt($s, "w+2#)1FP&LIPTL2<8I2");

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.60.0090.00616.63
8.3.50.0130.01221.97
8.3.40.0060.00918.60
8.3.30.0030.01018.76
8.3.20.0070.00020.08
8.3.10.0000.00823.69
8.3.00.0080.00019.38
8.2.180.0110.00718.66
8.2.170.0100.01022.96
8.2.160.0110.00422.09
8.2.150.0040.00424.18
8.2.140.0000.00724.66
8.2.130.0030.00917.62
8.2.120.0080.00026.35
8.2.110.0040.00420.35
8.2.100.0120.00017.84
8.2.90.0040.00418.03
8.2.80.0030.00618.16
8.2.70.0100.00017.63
8.2.60.0080.00317.38
8.2.50.0060.00318.07
8.2.40.0080.00019.23
8.2.30.0030.00520.68
8.2.20.0060.00317.80
8.2.10.0050.00218.14
8.2.00.0040.00418.15
8.1.280.0100.00725.92
8.1.270.0000.00922.16
8.1.260.0040.00428.09
8.1.250.0080.00028.09
8.1.240.0070.00322.07
8.1.230.0070.00721.04
8.1.220.0000.00817.75
8.1.210.0040.00418.77
8.1.200.0030.00517.22
8.1.190.0090.00017.10
8.1.180.0040.00418.10
8.1.170.0060.00318.95
8.1.160.0000.00722.04
8.1.150.0070.00018.82
8.1.140.0050.00319.54
8.1.130.0040.00417.63
8.1.120.0040.00417.40
8.1.110.0070.00017.38
8.1.100.0000.00817.43
8.1.90.0040.00417.47
8.1.80.0000.00817.39
8.1.70.0000.00717.27
8.1.60.0030.00617.62
8.1.50.0050.00317.57
8.1.40.0030.00617.57
8.1.30.0000.00817.60
8.1.20.0040.00417.59
8.1.10.0000.00817.59
8.1.00.0040.00417.44
8.0.300.0070.00019.90
8.0.290.0040.00416.63
8.0.280.0000.00718.40
8.0.270.0040.00417.26
8.0.260.0040.00417.10
8.0.250.0000.00717.01
8.0.240.0000.00716.97
8.0.230.0080.00016.92
8.0.220.0040.00416.93
8.0.210.0040.00316.93
8.0.200.0030.00517.02
8.0.190.0000.00716.99
8.0.180.0070.00016.92
8.0.170.0040.00416.82
8.0.160.0040.00416.95
8.0.150.0070.00016.99
8.0.140.0000.00716.83
8.0.130.0030.00313.38
8.0.120.0040.00416.87
8.0.110.0000.00716.89
8.0.100.0000.00716.81
8.0.90.0050.00216.81
8.0.80.0100.01116.91
8.0.70.0000.00716.76
8.0.60.0000.00716.73
8.0.50.0080.00016.77
8.0.30.0130.00617.18
8.0.20.0100.00817.40
8.0.10.0030.00516.99
8.0.00.0070.01216.70
7.4.330.0050.00015.08
7.4.320.0000.00616.50
7.4.300.0050.00216.56
7.4.290.0070.00016.63
7.4.280.0040.00416.52
7.4.270.0000.00716.62
7.4.260.0040.00416.52
7.4.250.0050.00216.60
7.4.240.0000.00816.65
7.4.230.0000.00716.54
7.4.220.0060.01116.75
7.4.210.0120.00916.65
7.4.200.0040.00416.34
7.4.160.0190.00316.53
7.4.150.0140.00417.40
7.4.140.0110.00917.86
7.4.130.0110.00916.60
7.4.120.0110.00616.64
7.4.110.0090.00916.50
7.4.100.0130.00616.45
7.4.90.0130.00916.53
7.4.80.0110.00719.39
7.4.70.0080.00816.70
7.4.60.0080.00816.51
7.4.50.0050.00016.42
7.4.40.0150.00616.49
7.4.30.0070.01416.62
7.4.00.0140.00415.14
7.3.330.0060.00013.29
7.3.320.0050.00013.42
7.3.310.0000.00716.54
7.3.300.0050.00216.43
7.3.290.0070.00916.44
7.3.280.0060.01216.47
7.3.270.0120.00817.40
7.3.260.0130.00416.46
7.3.250.0080.01116.62
7.3.240.0110.01116.56
7.3.230.0110.00616.59
7.3.210.0030.01316.76
7.3.200.0130.00316.34
7.3.190.0110.00716.67
7.3.180.0060.00916.38
7.3.170.0090.00616.64
7.3.160.0140.00716.53
7.2.330.0130.00616.63
7.2.320.0030.01416.70
7.2.310.0120.00916.35
7.2.300.0080.00816.41
7.2.290.0120.00616.50
7.2.60.0040.01116.64
7.2.00.0000.00919.38
7.1.200.0000.01515.48
7.1.100.0050.00518.34
7.1.70.0040.00416.86
7.1.60.0180.00619.48
7.1.50.0030.01016.57
7.1.00.0070.07322.40
7.0.200.0040.00416.77
7.0.60.0070.07020.05
7.0.50.0070.05317.98
7.0.40.0000.10020.05
7.0.30.0270.04020.16
7.0.20.0370.07720.16
7.0.10.0070.05320.30
7.0.00.0030.08720.06
5.6.280.0000.04021.05
5.6.210.0100.07720.77
5.6.200.0100.08318.36
5.6.190.0070.04020.67
5.6.180.0270.07720.66
5.6.170.0200.06020.48
5.6.160.0030.08720.48
5.6.150.0030.06318.17
5.6.140.0030.04318.16
5.6.130.0030.08318.18
5.6.120.0070.08321.02
5.6.110.0070.08321.05
5.6.100.0130.08021.11
5.6.90.0070.07021.03
5.6.80.0070.08320.55
5.5.350.2630.03320.43
5.5.340.0130.03718.02
5.5.330.0230.07020.47
5.5.320.0330.04320.36
5.5.310.0300.06020.27
5.5.300.0000.08718.03
5.5.290.0070.08317.99
5.5.280.0070.05320.73
5.5.270.0070.08020.72
5.5.260.0100.05020.91
5.5.250.0170.03320.86
5.5.240.0230.06720.08

preferences:
48.19 ms | 401 KiB | 5 Q