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.0110.01116.88
8.3.50.0040.01118.03
8.3.40.0150.00018.79
8.3.30.0040.01118.70
8.3.20.0040.00420.39
8.3.10.0060.00323.64
8.3.00.0040.00419.50
8.2.180.0060.01316.75
8.2.170.0070.01422.96
8.2.160.0070.00722.09
8.2.150.0030.00524.18
8.2.140.0080.00024.66
8.2.130.0030.00917.50
8.2.120.0040.00426.35
8.2.110.0100.00022.20
8.2.100.0080.00417.88
8.2.90.0000.00818.16
8.2.80.0030.00618.16
8.2.70.0080.00017.80
8.2.60.0030.00617.80
8.2.50.0040.00418.10
8.2.40.0080.00020.60
8.2.30.0030.00520.55
8.2.20.0030.00617.79
8.2.10.0000.00718.01
8.2.00.0040.00418.02
8.1.280.0030.01225.92
8.1.270.0050.00222.02
8.1.260.0040.00428.09
8.1.250.0060.00328.09
8.1.240.0090.00023.96
8.1.230.0060.00622.86
8.1.220.0080.00017.74
8.1.210.0040.00418.77
8.1.200.0030.00617.00
8.1.190.0030.00617.23
8.1.180.0050.00318.10
8.1.170.0040.00418.60
8.1.160.0050.00322.19
8.1.150.0030.00618.93
8.1.140.0040.00419.56
8.1.130.0040.00417.49
8.1.120.0030.00517.49
8.1.110.0000.00717.45
8.1.100.0030.00517.36
8.1.90.0040.00417.48
8.1.80.0040.00417.34
8.1.70.0050.00317.45
8.1.60.0000.00817.63
8.1.50.0040.00417.47
8.1.40.0030.00617.46
8.1.30.0000.00817.59
8.1.20.0030.00617.63
8.1.10.0050.00217.49
8.1.00.0030.00517.59
8.0.300.0050.00220.02
8.0.290.0090.00016.75
8.0.280.0030.00318.34
8.0.270.0040.00417.24
8.0.260.0040.00416.79
8.0.250.0000.00716.94
8.0.240.0030.00317.01
8.0.230.0000.00716.99
8.0.220.0050.00316.96
8.0.210.0030.00316.82
8.0.200.0030.00616.98
8.0.190.0000.00716.93
8.0.180.0040.00416.85
8.0.170.0040.00416.99
8.0.160.0070.00016.90
8.0.150.0000.00716.92
8.0.140.0040.00416.72
8.0.130.0060.00013.41
8.0.120.0040.00416.81
8.0.110.0050.00216.84
8.0.100.0080.00016.84
8.0.90.0030.00316.80
8.0.80.0040.01116.96
8.0.70.0050.00317.04
8.0.60.0070.00016.93
8.0.50.0080.00016.94
8.0.30.0110.00916.99
8.0.20.0120.00917.44
8.0.10.0000.00716.90
8.0.00.0080.01016.70
7.4.330.0000.00515.14
7.4.320.0030.00316.48
7.4.300.0030.00316.68
7.4.290.0000.00816.46
7.4.280.0000.00816.53
7.4.270.0030.00316.57
7.4.260.0000.00716.63
7.4.250.0050.00316.54
7.4.240.0010.00616.55
7.4.230.0070.00016.65
7.4.220.0120.00616.57
7.4.210.0030.01016.52
7.4.200.0000.00716.72
7.4.160.0110.00716.46
7.4.150.0150.00617.40
7.4.140.0120.00817.86
7.4.130.0140.00816.46
7.4.120.0070.01316.67
7.4.110.0110.00716.64
7.4.100.0090.00916.61
7.4.90.0070.01016.64
7.4.80.0090.00919.39
7.4.70.0120.00416.69
7.4.60.0070.01016.55
7.4.50.0030.00316.45
7.4.40.0080.00816.68
7.4.30.0040.01916.70
7.4.00.0080.00814.90
7.3.330.0000.00513.34
7.3.320.0020.00213.25
7.3.310.0030.00316.34
7.3.300.0030.00316.49
7.3.290.0070.00816.44
7.3.280.0100.00716.45
7.3.270.0050.01317.40
7.3.260.0120.01216.47
7.3.250.0110.00716.64
7.3.240.0070.01116.48
7.3.230.0070.01116.43
7.3.210.0120.00616.65
7.3.200.0120.00916.79
7.3.190.0100.01016.54
7.3.180.0070.01416.45
7.3.170.0100.00616.70
7.3.160.0060.00916.60
7.3.120.0060.01214.93
7.3.110.0030.01414.98
7.3.100.0060.00915.04
7.3.90.0070.00714.73
7.3.80.0080.00815.05
7.3.70.0000.01714.71
7.3.60.0090.00914.82
7.3.50.0060.00614.90
7.3.40.0040.00714.95
7.3.30.0080.00315.08
7.3.20.0000.01316.75
7.3.10.0040.00816.47
7.3.00.0090.00616.54
7.2.330.0090.01316.66
7.2.320.0100.00716.52
7.2.310.0060.01116.66
7.2.300.0130.00416.45
7.2.290.0130.00916.55
7.2.250.0110.00715.01
7.2.240.0070.01014.75
7.2.230.0060.00614.83
7.2.220.0030.01215.27
7.2.210.0030.01014.90
7.2.200.0040.01114.80
7.2.190.0140.00015.08
7.2.180.0040.01115.19
7.2.170.0090.00615.04
7.2.60.0070.00716.66
7.2.00.0040.00819.19
7.1.330.0040.01215.90
7.1.320.0070.00715.69
7.1.310.0090.00915.79
7.1.300.0060.00915.84
7.1.290.0080.00315.86
7.1.280.0040.00815.74
7.1.270.0080.00315.83
7.1.260.0080.00715.94
7.1.200.0030.01015.79
7.1.100.0060.00318.25
7.1.70.0030.00517.07
7.1.60.0130.01019.48
7.1.50.0080.00316.74
7.1.00.0100.07022.51
7.0.200.0000.00716.58
7.0.60.0070.07721.77
7.0.50.0030.08317.92
7.0.40.0070.06720.13
7.0.30.0300.03720.30
7.0.20.0400.07020.30
7.0.10.0170.04020.22
7.0.00.0100.08020.26
5.6.280.0100.05321.08
5.6.210.0100.08320.73
5.6.200.0070.08018.17
5.6.190.0070.05320.68
5.6.180.0330.07020.54
5.6.170.0300.05020.39
5.6.160.0070.09020.71
5.6.150.0030.08718.25
5.6.140.0070.05318.14
5.6.130.0100.07718.24
5.6.120.0230.07321.14
5.6.110.0030.04321.05
5.6.100.0200.07021.04
5.6.90.0030.09321.11
5.6.80.0130.07020.46
5.5.350.0000.08320.48
5.5.340.0070.07318.04
5.5.330.0070.07320.32
5.5.320.0230.08720.31
5.5.310.0330.07020.36
5.5.300.0000.08717.99
5.5.290.0030.05017.98
5.5.280.0070.08720.89
5.5.270.0070.05020.88
5.5.260.0030.07720.78
5.5.250.0100.07020.66
5.5.240.0030.08020.17

preferences:
45.56 ms | 400 KiB | 5 Q