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.0140.00716.88
8.3.50.0070.00718.05
8.3.40.0070.00718.72
8.3.30.0140.00018.79
8.3.20.0080.00020.16
8.3.10.0080.00023.48
8.3.00.0000.00819.38
8.2.180.0130.00318.41
8.2.170.0070.01322.96
8.2.160.0120.00822.21
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0040.00717.50
8.2.120.0080.00026.35
8.2.110.0030.00720.93
8.2.100.0000.01117.72
8.2.90.0080.00018.03
8.2.80.0080.00017.97
8.2.70.0060.00317.50
8.2.60.0040.00417.68
8.2.50.0090.00018.07
8.2.40.0040.00419.41
8.2.30.0070.00020.67
8.2.20.0060.00317.61
8.2.10.0040.00418.16
8.2.00.0050.00317.98
8.1.280.0070.00725.92
8.1.270.0040.00423.66
8.1.260.0070.00028.09
8.1.250.0090.00028.09
8.1.240.0170.00320.78
8.1.230.0080.00320.85
8.1.220.0080.00017.74
8.1.210.0030.00618.88
8.1.200.0060.00317.25
8.1.190.0040.00417.25
8.1.180.0050.00218.10
8.1.170.0060.00318.94
8.1.160.0030.00521.87
8.1.150.0070.00018.83
8.1.140.0040.00419.56
8.1.130.0040.00417.65
8.1.120.0000.00717.43
8.1.110.0040.00417.45
8.1.100.0060.00317.39
8.1.90.0070.00017.30
8.1.80.0070.00017.33
8.1.70.0050.00217.36
8.1.60.0030.00617.63
8.1.50.0030.00617.46
8.1.40.0000.00817.55
8.1.30.0030.00517.66
8.1.20.0020.00517.66
8.1.10.0030.00517.66
8.1.00.0040.00417.58
8.0.300.0000.00719.98
8.0.290.0060.00316.63
8.0.280.0030.00318.42
8.0.270.0030.00317.25
8.0.260.0070.00017.24
8.0.250.0080.00016.90
8.0.240.0030.00316.93
8.0.230.0000.00717.01
8.0.220.0070.00016.92
8.0.210.0000.00716.97
8.0.200.0040.00416.99
8.0.190.0080.00017.02
8.0.180.0000.00717.04
8.0.170.0030.00516.94
8.0.160.0070.00017.03
8.0.150.0000.00716.84
8.0.140.0040.00416.92
8.0.130.0000.00513.43
8.0.120.0050.00216.89
8.0.110.0040.00416.93
8.0.100.0040.00416.91
8.0.90.0080.00016.91
8.0.80.0120.00316.86
8.0.70.0000.00816.96
8.0.60.0000.00816.89
8.0.50.0000.00816.80
8.0.30.0110.01017.16
8.0.20.0130.00517.40
8.0.10.0070.00016.95
8.0.00.0100.00916.71
7.4.330.0050.00015.08
7.4.320.0000.00616.61
7.4.300.0000.00616.59
7.4.290.0030.00316.63
7.4.280.0050.00316.46
7.4.270.0030.00316.63
7.4.260.0040.00416.56
7.4.250.0000.00716.45
7.4.240.0030.00516.57
7.4.230.0030.00316.75
7.4.220.0120.01016.45
7.4.210.0100.01016.59
7.4.200.0000.00716.48
7.4.160.0140.00716.59
7.4.150.0120.00617.40
7.4.140.0160.00417.86
7.4.130.0100.00816.63
7.4.120.0080.01116.67
7.4.110.0130.01016.57
7.4.100.0040.01416.57
7.4.90.0130.00916.66
7.4.80.0100.01019.39
7.4.70.0080.01016.50
7.4.60.0070.01016.59
7.4.50.0090.00016.68
7.4.40.0130.00616.50
7.4.30.0130.00916.61
7.4.00.0030.01215.25
7.3.330.0030.00313.48
7.3.320.0050.00013.29
7.3.310.0040.00416.58
7.3.300.0000.00716.30
7.3.290.0080.00616.47
7.3.280.0110.00816.47
7.3.270.0060.01117.40
7.3.260.0150.00416.65
7.3.250.0090.00816.57
7.3.240.0080.01116.72
7.3.230.0040.01516.58
7.3.210.0070.01016.65
7.3.200.0090.00616.50
7.3.190.0090.00616.43
7.3.180.0030.01316.70
7.3.170.0130.00316.70
7.3.160.0080.00816.48
7.2.330.0060.01616.70
7.2.320.0140.00316.73
7.2.310.0030.01316.43
7.2.300.0100.00816.63
7.2.290.0070.01416.46
7.2.60.0030.01316.53
7.2.00.0070.01119.38
7.1.200.0120.00715.57
7.1.100.0060.01018.10
7.1.70.0050.00217.07
7.1.60.0150.00919.48
7.1.50.0070.00716.58
7.1.00.0000.08022.33
7.0.200.0040.00416.75
7.0.60.0070.07019.92
7.0.50.0070.06017.95
7.0.40.0070.05020.18
7.0.30.0230.04020.27
7.0.20.0330.08320.09
7.0.10.0070.08320.06
7.0.00.0000.05720.15
5.6.280.0000.05321.08
5.6.210.0100.08020.71
5.6.200.0170.07718.16
5.6.190.0030.04720.59
5.6.180.0230.07720.65
5.6.170.0330.08320.59
5.6.160.0100.08020.50
5.6.150.0130.04018.27
5.6.140.0100.07718.29
5.6.130.0100.03318.16
5.6.120.0070.06721.06
5.6.110.0030.04021.07
5.6.100.0070.08721.02
5.6.90.0130.08321.09
5.6.80.0030.07320.53
5.5.350.0070.03720.45
5.5.340.0070.04718.05
5.5.330.0070.04720.30
5.5.320.0230.08320.40
5.5.310.0370.08720.36
5.5.300.0100.08018.02
5.5.290.0130.08018.00
5.5.280.0030.08720.91
5.5.270.0030.09020.91
5.5.260.0170.06020.72
5.5.250.0070.09020.80
5.5.240.0170.07720.17

preferences:
51.45 ms | 401 KiB | 5 Q