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("4OkyDTPIuCi3PcQr5xwrkhWYHDu3J8loHA/D12BwVNTRk+gziMZYbCNCcIO0du92", "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.0120.00316.75
8.3.50.0130.00922.11
8.3.40.0110.00418.92
8.3.30.0130.00318.86
8.3.20.0060.00320.20
8.3.10.0040.00423.48
8.3.00.0050.00319.38
8.2.180.0000.01518.31
8.2.170.0040.01122.96
8.2.160.0180.00322.11
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0100.00317.50
8.2.120.0080.00026.35
8.2.110.0040.00721.12
8.2.100.0040.00717.62
8.2.90.0000.00817.97
8.2.80.0000.00817.97
8.2.70.0000.00817.50
8.2.60.0060.00317.80
8.2.50.0040.00418.07
8.2.40.0040.00419.31
8.2.30.0040.00420.69
8.2.20.0000.00917.67
8.2.10.0040.00417.98
8.2.00.0030.00518.11
8.1.280.0040.01125.92
8.1.270.0060.00323.83
8.1.260.0050.00228.09
8.1.250.0050.00228.09
8.1.240.0080.00820.45
8.1.230.0070.00420.71
8.1.220.0040.00417.74
8.1.210.0030.00618.91
8.1.200.0090.00017.35
8.1.190.0050.00317.23
8.1.180.0000.00818.10
8.1.170.0040.00418.93
8.1.160.0000.00821.99
8.1.150.0000.00718.82
8.1.140.0000.00819.60
8.1.130.0000.00717.79
8.1.120.0070.00017.35
8.1.110.0000.00717.39
8.1.100.0040.00417.36
8.1.90.0040.00417.44
8.1.80.0040.00417.37
8.1.70.0040.00417.30
8.1.60.0000.00917.51
8.1.50.0040.00417.47
8.1.40.0040.00417.45
8.1.30.0080.00017.53
8.1.20.0070.00017.68
8.1.10.0050.00317.52
8.1.00.0000.00817.44
8.0.300.0050.00320.06
8.0.290.0030.00616.88
8.0.280.0000.00718.33
8.0.270.0040.00417.15
8.0.260.0040.00417.24
8.0.250.0020.00516.95
8.0.240.0070.00016.94
8.0.230.0000.00716.87
8.0.220.0000.00716.92
8.0.210.0000.00716.96
8.0.200.0030.00517.02
8.0.190.0000.00717.02
8.0.180.0040.00416.96
8.0.170.0050.00216.85
8.0.160.0040.00416.86
8.0.150.0030.00516.98
8.0.140.0040.00416.90
8.0.130.0030.00313.45
8.0.120.0040.00416.88
8.0.110.0040.00416.99
8.0.100.0040.00416.89
8.0.90.0040.00416.81
8.0.80.0060.00916.99
8.0.70.0000.00716.93
8.0.60.0030.00516.96
8.0.50.0040.00416.83
8.0.30.0100.00617.06
8.0.20.0140.00817.40
8.0.10.0070.00017.10
8.0.00.0080.00916.94
7.4.330.0020.00215.09
7.4.320.0000.00616.48
7.4.300.0000.00616.46
7.4.290.0050.00216.67
7.4.280.0060.00316.65
7.4.270.0000.00616.61
7.4.260.0030.00316.71
7.4.250.0000.00816.64
7.4.240.0020.00516.63
7.4.230.0030.00316.75
7.4.220.0140.00316.68
7.4.210.0000.01416.58
7.4.200.0070.00016.30
7.4.160.0130.01016.61
7.4.150.0070.01017.40
7.4.140.0150.01117.86
7.4.130.0090.01116.56
7.4.120.0060.01116.58
7.4.110.0110.00716.52
7.4.100.0070.01516.54
7.4.90.0070.01016.46
7.4.80.0110.00819.39
7.4.70.0100.00716.50
7.4.60.0130.00316.55
7.4.50.0000.00416.64
7.4.40.0030.01916.70
7.4.30.0110.01116.54
7.4.00.0000.01614.84
7.3.330.0060.00013.49
7.3.320.0000.00513.55
7.3.310.0070.00016.38
7.3.300.0050.00216.34
7.3.290.0070.01016.44
7.3.280.0080.00916.47
7.3.270.0120.00617.40
7.3.260.0100.00916.55
7.3.250.0070.01116.58
7.3.240.0080.01116.58
7.3.230.0070.01416.54
7.3.210.0100.00616.52
7.3.200.0040.01216.65
7.3.190.0060.00916.46
7.3.180.0040.01216.40
7.3.170.0060.01116.49
7.3.160.0030.01316.64
7.3.10.0090.00916.23
7.3.00.0160.01016.24
7.2.330.0140.00416.67
7.2.320.0070.01016.63
7.2.310.0070.01016.35
7.2.300.0060.01216.59
7.2.290.0100.00716.81
7.2.130.0140.00716.57
7.2.120.0090.01316.43
7.2.110.0070.01116.31
7.2.100.0040.01116.43
7.2.90.0170.00016.64
7.2.80.0060.00316.60
7.2.70.0110.00716.62
7.2.60.0120.00416.51
7.2.50.0050.01316.63
7.2.40.0060.01016.53
7.2.30.0070.01116.95
7.2.20.0110.00316.44
7.2.10.0000.01016.63
7.2.00.0070.00718.13
7.1.250.0080.01215.43
7.1.200.0100.00315.44
7.1.100.0030.01017.80
7.1.70.0000.00817.15
7.1.60.0100.01419.48
7.1.50.0040.00816.81
7.1.00.0070.07022.30
7.0.200.0000.00816.82
7.0.60.0000.04320.03
7.0.50.0100.08018.11
7.0.40.0030.05320.27
7.0.30.0200.04320.11
7.0.20.0400.03720.30
7.0.10.0030.08320.30
7.0.00.0030.04320.23
5.6.280.0030.03721.07
5.6.210.0170.07020.77
5.6.200.0030.07318.14
5.6.190.0070.03720.57
5.6.180.0170.07320.58
5.6.170.0400.07720.71
5.6.160.0170.07720.44
5.6.150.0030.06318.19
5.6.140.0030.04718.19
5.6.130.0100.03718.16
5.6.120.0130.07721.02
5.6.110.0030.04321.02
5.6.100.0100.09021.02
5.6.90.0070.08321.12
5.6.80.0170.05720.43
5.5.350.3570.04320.41
5.5.340.0100.07718.07
5.5.330.0070.08720.45
5.5.320.0300.07320.35
5.5.310.0470.06720.35
5.5.300.0130.07318.03
5.5.290.0030.06718.05
5.5.280.0130.06020.92
5.5.270.0070.08320.88
5.5.260.0030.06720.91
5.5.250.0100.04720.66
5.5.240.0200.08020.17

preferences:
42.88 ms | 401 KiB | 5 Q