3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Main Code By: Khucing Ithem : https://www.facebook.com/backcat * Make with Class by: hrace009 **/ $data = 'Text ini akan di encrypt menggunakan openssl! dan akan di decrypt dengan openssl juga'; $secretKey = 'mykey'; class MyCrypt { public static function safe_encode ($text) { return md5(trim(strtr(base64_encode($text), '+/=', '-_,'))); } public static function safe_decode($text) { return md5(base64_decode(strtr($text, '-_,', '+/='))); } public static function encrypt($data, $secretKey) { $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length('AES-256-CBC')); $cipher = openssl_encrypt($data, 'AES-256-CBC', $secretKey, 0, $iv); $safe_cipher = MyCrypt::safe_encode($cipher); $safe_iv = MyCrypt::safe_encode($iv); return $safe_cipher . '::' . $safe_iv; } public static function decrypt($encrypted, $secretKey) { $token = explode('::', $encrypted); $cipher = MyCrypt::safe_decode($token[0]); $iv = MyCrypt::safe_decode($token[1]); $plain = openssl_decrypt($cipher, 'AES-256-CBC', $secretKey, 0, $iv); return trim($plain); } } $encrypted = MyCrypt::encrypt($data, $secretKey); $decrypted = MyCrypt::decrypt($encrypted, $secretKey); var_dump('Encrypted: ' . $encrypted); var_dump('Decrypted: ' . $decrypted); ?>

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.0130.00316.75
8.3.50.0140.00321.21
8.3.40.0070.00718.98
8.3.30.0040.01118.71
8.3.20.0080.00020.19
8.3.10.0000.00821.94
8.3.00.0070.00317.50
8.2.180.0140.00017.00
8.2.170.0040.01422.96
8.2.160.0130.00719.45
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00420.38
8.2.120.0140.00426.35
8.2.110.0030.00620.52
8.2.100.0040.00817.91
8.2.90.0060.00317.91
8.2.80.0040.00418.15
8.2.70.0060.00317.63
8.2.60.0030.00517.63
8.2.50.0000.00918.10
8.2.40.0020.00520.20
8.2.30.0080.00019.09
8.2.20.0070.00318.02
8.2.10.0030.00318.26
8.2.00.0000.00718.25
8.1.280.0140.00025.92
8.1.270.0040.00422.20
8.1.260.0180.00026.35
8.1.250.0000.01728.09
8.1.240.0070.00319.15
8.1.230.0100.00020.65
8.1.220.0080.00017.74
8.1.210.0030.00718.77
8.1.200.0040.00417.22
8.1.190.0000.00817.22
8.1.180.0040.00418.10
8.1.170.0030.00618.64
8.1.160.0000.00818.91
8.1.150.0040.00420.14
8.1.140.0080.00019.54
8.1.130.0040.00419.04
8.1.120.0040.00417.41
8.1.110.0040.00417.35
8.1.100.0040.00417.40
8.1.90.0000.00717.31
8.1.80.0050.00217.38
8.1.70.0030.00317.46
8.1.60.0000.00817.50
8.1.50.0000.00717.39
8.1.40.0050.00317.43
8.1.30.0030.00517.53
8.1.20.0000.00717.61
8.1.10.0000.00717.56
8.1.00.0040.00417.52
8.0.300.0040.00419.82
8.0.290.0060.00316.63
8.0.280.0000.00718.52
8.0.270.0030.00317.17
8.0.260.0070.00419.03
8.0.250.0070.00016.88
8.0.240.0040.00417.02
8.0.230.0030.00316.96
8.0.220.0070.00016.95
8.0.210.0000.00716.88
8.0.200.0060.00316.97
8.0.190.0000.00716.99
8.0.180.0000.00716.89
8.0.170.0040.00416.93
8.0.160.0000.00716.90
8.0.150.0040.00416.94
8.0.140.0000.00716.84
8.0.130.0050.00013.38
8.0.120.0040.00416.89
8.0.110.0030.00316.80
8.0.100.0000.00816.98
8.0.90.0040.00416.98
8.0.80.0070.01616.98
8.0.70.0020.00516.86
8.0.60.0000.00716.93
8.0.50.0000.00816.75
8.0.30.0070.01417.10
8.0.20.0120.00817.40
8.0.10.0030.00617.02
8.0.00.0130.00616.76
7.4.330.0000.00615.55
7.4.320.0000.00616.46
7.4.300.0000.00616.52
7.4.290.0060.00316.52
7.4.280.0080.00016.42
7.4.270.0030.00316.50
7.4.260.0000.00716.61
7.4.250.0030.00316.48
7.4.240.0000.00716.48
7.4.230.0030.00316.46
7.4.220.0090.00916.56
7.4.210.0100.01016.65
7.4.200.0030.00416.67
7.4.160.0110.00616.50
7.4.150.0120.00617.40
7.4.140.0150.00617.86
7.4.130.0120.00616.46
7.4.120.0080.01216.57
7.4.110.0060.01016.43
7.4.100.0030.02416.45
7.4.90.0160.00016.50
7.4.80.0150.00319.39
7.4.70.0100.00716.68
7.4.60.0030.01316.39
7.4.50.0080.00816.31
7.4.40.0030.01316.54
7.4.30.0090.00916.55
7.4.00.0110.00715.28
7.3.330.0030.00313.35
7.3.320.0050.00013.34
7.3.310.0030.00316.41
7.3.300.0070.00016.29
7.3.290.0060.01216.38
7.3.280.0080.01016.40
7.3.270.0130.00317.40
7.3.260.0080.01516.47
7.3.250.0130.00716.37
7.3.240.0080.01016.42
7.3.230.0100.01016.56
7.3.210.0070.01116.60
7.3.200.0100.01016.47
7.3.190.0100.00716.60
7.3.180.0070.01016.60
7.3.170.0040.01316.56
7.3.160.0090.00616.38
7.3.120.0030.01415.12
7.3.110.0070.01014.54
7.3.100.0060.00914.66
7.3.90.0070.00714.77
7.3.80.0030.00914.59
7.3.70.0040.00814.79
7.3.60.0030.01314.55
7.3.50.0030.00615.03
7.3.40.0040.00814.84
7.3.30.0050.00514.99
7.3.20.0090.00316.50
7.3.10.0060.00616.65
7.3.00.0120.00016.34
7.2.330.0100.00716.51
7.2.320.0080.00816.61
7.2.310.0160.00716.43
7.2.300.0100.01016.62
7.2.290.0120.00416.29
7.2.250.0060.01314.74
7.2.240.0050.01414.77
7.2.230.0000.01114.96
7.2.220.0060.00915.13
7.2.210.0080.00415.07
7.2.200.0140.00314.73
7.2.190.0040.00814.90
7.2.180.0040.00714.86
7.2.170.0110.00414.89
7.1.330.0040.01115.44
7.1.320.0080.00815.77
7.1.310.0000.01315.29
7.1.300.0130.00315.79
7.1.290.0060.00615.76
7.1.280.0100.00715.78
7.1.270.0030.00615.83
7.1.260.0040.00815.70
7.1.70.0030.00517.34
7.1.60.0070.00317.54
7.1.50.0030.02017.07
7.1.40.0870.02032.77
7.1.30.0600.02032.83
7.1.20.0600.01033.04
7.1.10.0500.00314.82
7.1.00.0400.01314.93
7.0.200.0100.01016.52
7.0.180.0500.00714.33
7.0.170.0570.01314.44
7.0.160.0470.01314.34
7.0.150.0400.01014.59
7.0.140.0470.00714.55
7.0.130.0500.01314.65
7.0.120.0400.01014.78
7.0.110.0430.01014.39
7.0.100.0400.01014.45
7.0.90.0500.00714.53
7.0.80.0400.01314.49
7.0.70.0470.00714.52
7.0.60.0470.00314.30
7.0.50.0430.01014.41
7.0.40.0430.01014.85
7.0.30.0670.01314.81
7.0.20.0630.01314.68
7.0.10.1170.00714.54
7.0.00.0470.00714.70

preferences:
60.66 ms | 401 KiB | 5 Q