3v4l.org

run code in 300+ PHP versions simultaneously
<? /* * DEFINE CONSTANTS */ $HashPassPhrase = "passpharse"; $HashSalt = "saltvalue"; $HashAlgorithm = "SHA1"; $HashIterations = "2"; $InitVector = "1a2b3c4d5e6f7g8h"; // Must be 16 bytes $keySize = "256"; class Cipher { private $securekey, $iv; function __construct($textkey) { $this->securekey = hash($HashAlgorithm,$textkey,TRUE); $this->iv = $InitVector; } function encrypt($input) { return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this->securekey, $input, MCRYPT_MODE_CBC, $this->iv)); } function decrypt($input) { return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this->securekey, base64_decode($input), MCRYPT_MODE_CBC, $this->iv)); } } $cipher = new Cipher($HashPassPhrase); $encryptedtext = $cipher->encrypt("Text To Encrypt"); echo "->encrypt = $encryptedtext<br />"; $decryptedtext = $cipher->decrypt($encryptedtext); echo "->decrypt = $decryptedtext<br />"; var_dump($cipher); ?>

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.0070.00716.63
8.3.50.0070.01222.04
8.3.40.0070.00718.62
8.3.30.0200.00018.65
8.3.20.0040.00420.21
8.3.10.0000.00823.41
8.3.00.0080.00023.70
8.2.180.0100.01017.91
8.2.170.0090.00622.96
8.2.160.0110.00320.31
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0090.00019.86
8.2.120.0060.00326.35
8.2.110.0060.00321.11
8.2.100.0060.00617.66
8.2.90.0040.00417.49
8.2.80.0040.00417.97
8.2.70.0050.00317.91
8.2.60.0040.00417.80
8.2.50.0000.00818.10
8.2.40.0040.00420.47
8.2.30.0000.00720.63
8.2.20.0040.00417.52
8.2.10.0000.00717.92
8.2.00.0040.00418.05
8.1.280.0030.01325.92
8.1.270.0040.00422.00
8.1.260.0030.00528.09
8.1.250.0070.00028.09
8.1.240.0090.00021.30
8.1.230.0040.00818.98
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0030.00617.10
8.1.190.0060.00317.10
8.1.180.0050.00318.10
8.1.170.0000.00818.52
8.1.160.0030.00320.63
8.1.150.0050.00318.63
8.1.140.0040.00719.43
8.1.130.0070.00018.85
8.1.120.0040.00317.19
8.1.110.0040.00417.22
8.1.100.0070.00017.31
8.1.90.0040.00417.30
8.1.80.0040.00517.21
8.1.70.0070.00017.29
8.1.60.0040.00417.33
8.1.50.0060.00317.21
8.1.40.0080.00017.37
8.1.30.0000.00817.46
8.1.20.0000.00717.57
8.1.10.0040.00417.37
8.1.00.0070.00017.20
8.0.300.0000.00719.57
8.0.290.0080.00016.63
8.0.280.0000.00718.30
8.0.270.0030.00317.11
8.0.260.0060.00016.75
8.0.250.0030.00316.89
8.0.240.0050.00316.68
8.0.230.0050.00316.84
8.0.220.0000.00716.73
8.0.210.0000.00716.73
8.0.200.0000.00716.86
8.0.190.0060.00616.78
8.0.180.0050.00216.66
8.0.170.0090.00016.66
8.0.160.0030.00316.89
8.0.150.0070.00016.77
8.0.140.0040.00416.76
8.0.130.0000.00713.41
8.0.120.0030.00616.77
8.0.110.0050.00316.82
8.0.100.0040.00416.75
8.0.90.0000.00816.71
8.0.80.0120.00316.73
8.0.70.0000.00716.63
8.0.60.0090.00016.79
8.0.50.0080.00016.65
8.0.30.0090.00716.74
8.0.20.0050.01217.40
8.0.10.0000.00716.69
8.0.00.0120.00916.72
7.4.330.0050.00016.79
7.4.320.0030.00316.41
7.4.300.0060.00016.27
7.4.290.0030.00316.45
7.4.280.0000.01016.36
7.4.270.0030.00316.32
7.4.260.0000.00816.37
7.4.250.0000.00716.44
7.4.240.0020.00616.46
7.4.230.0070.00016.57
7.4.220.0140.01316.53
7.4.210.0070.00716.38
7.4.200.0020.00516.39
7.4.160.0110.00616.20
7.4.150.0170.00017.40
7.4.140.0080.01117.86
7.4.130.0090.00916.45
7.4.120.0060.01516.31
7.4.110.0070.01116.29
7.4.100.0130.01016.32
7.4.90.0120.01216.38
7.4.80.0060.01019.39
7.4.70.0100.00616.37
7.4.60.0140.00716.52
7.4.50.0000.01616.43
7.4.40.0060.00916.39
7.4.30.0060.01216.27
7.4.00.0090.00914.57
7.3.330.0000.00713.36
7.3.320.0000.00613.32
7.3.310.0080.00016.18
7.3.300.0000.00616.12
7.3.290.0000.00716.04
7.3.280.0070.00816.11
7.3.270.0100.01017.40
7.3.260.0070.01516.46
7.3.250.0140.00416.27
7.3.240.0100.00616.32
7.3.230.0100.00716.39
7.3.210.0070.01016.42
7.3.200.0150.00619.39
7.3.190.0080.00816.34
7.3.180.0140.00316.43
7.3.170.0070.01016.35
7.3.160.0150.00716.42
7.3.10.0130.00616.35
7.3.00.0060.00616.39
7.2.330.0070.01116.29
7.2.320.0100.00716.59
7.2.310.0040.01116.59
7.2.300.0130.01016.45
7.2.290.0090.00916.33
7.2.130.0070.00816.69
7.2.120.0090.00416.67
7.2.110.0380.00616.36
7.2.100.0070.00716.50
7.2.90.0100.00616.50
7.2.80.0210.00416.44
7.2.70.0100.00516.78
7.2.60.0080.00716.82
7.2.50.0090.00816.77
7.2.40.0090.00816.51
7.2.30.0030.01116.61
7.2.20.0120.00616.63
7.2.10.0100.00516.79
7.2.00.0070.00817.54
7.1.250.0120.00515.89
7.1.240.0060.00615.70
7.1.230.0040.00415.63
7.1.220.0040.01115.72
7.1.210.0070.00715.75
7.1.200.0090.00315.62
7.1.190.0040.01115.79
7.1.180.0000.01115.71
7.1.170.0110.00015.80
7.1.160.0060.00615.84
7.1.150.0000.01415.83
7.1.140.0030.01315.79
7.1.130.0060.00615.92
7.1.120.0100.00315.45
7.1.110.0030.00915.69
7.1.100.0050.00616.90
7.1.90.0110.00415.81
7.1.80.0000.01715.61
7.1.70.0020.00916.31
7.1.60.0090.01217.48
7.1.50.0060.01116.44
7.1.40.0090.00615.73
7.1.30.0080.00815.91
7.1.20.0030.01015.61
7.1.10.0070.00715.53
7.1.00.0070.03719.15
7.0.330.0030.00715.36
7.0.320.0100.00315.29
7.0.310.0030.00915.05
7.0.300.0000.01315.23
7.0.290.0070.00715.32
7.0.280.0030.00615.24
7.0.270.0030.00515.28
7.0.260.0030.01115.33
7.0.250.0040.00715.57
7.0.240.0060.00615.18
7.0.230.0090.00615.39
7.0.220.0070.00715.27
7.0.210.0080.00215.11
7.0.200.0070.00815.16
7.0.190.0090.00415.19
7.0.180.0100.00315.31
7.0.170.0070.00315.43
7.0.160.0000.01115.37
7.0.150.0030.00615.44
7.0.140.0040.00815.50
7.0.130.0030.00715.12
7.0.120.0090.00615.50
7.0.110.0080.00015.37
7.0.100.0060.00615.42
7.0.90.0100.00315.28
7.0.80.0090.00015.21
7.0.70.0030.00615.43
7.0.60.0050.04718.53
7.0.50.0030.04716.75
7.0.40.0100.04516.74
7.0.30.0120.04216.84
7.0.20.0180.04416.78
7.0.10.0070.03716.84
7.0.00.0050.04716.80
5.6.380.0060.00913.96
5.6.370.0000.01514.57
5.6.360.0000.00914.53
5.6.350.0050.00314.47
5.6.340.0030.01014.57
5.6.330.0030.01014.04
5.6.320.0060.00914.69
5.6.310.0140.00014.10
5.6.300.0100.00614.73
5.6.290.0060.00614.35
5.6.280.0070.01917.78
5.6.270.0080.00814.09
5.6.260.0040.01114.18
5.6.250.0080.00814.65
5.6.240.0000.01014.24
5.6.230.0050.00514.25
5.6.220.0120.00614.30
5.6.210.0050.02317.41
5.6.200.0110.02616.25
5.6.190.0070.03917.50
5.6.180.0170.01817.49
5.6.170.0140.03917.37
5.6.160.0140.04117.41
5.6.150.0090.03716.34
5.6.140.0050.04516.31
5.6.130.0050.02316.40
5.6.120.0100.04217.67
5.6.110.0090.04517.66
5.6.100.0040.04117.75
5.6.90.0030.04717.58
5.6.80.0020.02717.46
5.6.70.0140.00314.39
5.6.60.0070.00414.36
5.6.50.0000.01414.13
5.6.40.0030.01014.03
5.6.30.0060.00314.38
5.6.20.0100.00714.08
5.6.10.0030.01014.32
5.6.00.0000.01614.09
5.5.380.0040.00711.18
5.5.370.0030.01011.18
5.5.360.0080.00011.18
5.5.350.0020.04315.83
5.5.340.0120.03214.70
5.5.330.0100.04115.90
5.5.320.0220.03015.76
5.5.310.0120.04015.81
5.5.300.0070.02014.66
5.5.290.0080.04014.60
5.5.280.0030.03816.07
5.5.270.0030.04216.08
5.5.260.0060.03816.10
5.5.250.0150.03615.96
5.5.240.0130.04215.76
5.5.230.0060.00011.23
5.5.220.0000.00711.29
5.5.210.0040.00711.38
5.5.200.0030.00711.24
5.5.190.0030.01011.18
5.5.180.0000.00611.18
5.5.170.0030.00611.18
5.5.160.0000.00711.18
5.5.150.0060.00611.18
5.5.140.0000.00911.18
5.5.130.0000.00911.25
5.5.120.0070.00311.31
5.5.110.0030.00911.18
5.5.100.0060.00611.18
5.5.90.0000.00811.18
5.5.80.0000.01011.30
5.5.70.0030.00611.18
5.5.60.0030.00711.20
5.5.50.0030.00911.18
5.5.40.0040.00711.29
5.5.30.0100.00011.30
5.5.20.0030.00911.18
5.5.10.0000.01311.25
5.5.00.0030.00811.29

preferences:
52.51 ms | 401 KiB | 5 Q