3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('SALT', '1234'); $string = ' string to be encrypted '; // note the spaces $iv = mcrypt_create_iv( mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC), MCRYPT_DEV_URANDOM ); $encrypted = base64_encode( $iv . mcrypt_encrypt( MCRYPT_RIJNDAEL_128, hash('sha256', SALT, true), $string, MCRYPT_MODE_CBC, $iv ) ); $data = base64_decode($encrypted); $iv = substr($data, 0, mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC)); $decrypted = rtrim( mcrypt_decrypt( MCRYPT_RIJNDAEL_128, hash('sha256', SALT, true), substr($data, mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC)), MCRYPT_MODE_CBC, $iv ), "\0" ); echo 'Encrypted:' . "\n"; var_dump($encrypted); echo "\n"; echo 'Decrypted:' . "\n"; var_dump($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.5.10.0110.00620.08
8.5.00.0110.00920.12
8.4.150.0030.00014.05
8.4.140.0160.00617.86
8.4.130.0100.01017.85
8.4.120.0110.00922.23
8.4.110.0090.01022.41
8.4.100.0100.01118.53
8.4.90.0130.00718.95
8.4.80.0050.00320.44
8.4.70.0050.00418.23
8.4.60.0090.00118.97
8.4.50.0120.00820.37
8.4.40.0100.01021.19
8.4.30.0070.01417.64
8.4.20.0180.00317.96
8.4.10.0090.00019.86
8.3.280.0130.00718.68
8.3.270.0090.01316.85
8.3.260.0090.01016.64
8.3.250.0100.00718.58
8.3.240.0130.00817.30
8.3.230.0110.00716.47
8.3.220.0080.00718.88
8.3.210.0100.01016.90
8.3.200.0120.00716.84
8.3.190.0050.00917.17
8.3.180.0100.01016.59
8.3.170.0140.00420.74
8.3.160.0140.00417.11
8.3.150.0090.00917.13
8.3.140.0040.00418.37
8.3.130.0130.00716.80
8.3.120.0060.00318.91
8.3.110.0050.00320.94
8.3.100.0100.00024.06
8.3.90.0130.00726.77
8.3.80.0060.00318.53
8.3.70.0110.00416.63
8.3.60.0030.01716.63
8.3.50.0200.00621.84
8.3.40.0090.00618.79
8.3.30.0070.00718.61
8.3.20.0050.00219.14
8.3.10.0080.00021.67
8.3.00.0080.00022.37
8.2.290.0050.01020.56
8.2.280.0090.00218.61
8.2.270.0060.01319.04
8.2.260.0110.00716.84
8.2.250.0040.00416.82
8.2.240.0060.00317.12
8.2.230.0000.01122.58
8.2.220.0030.00637.54
8.2.210.0120.00326.77
8.2.200.0060.00316.88
8.2.190.0100.00617.00
8.2.180.0160.00318.42
8.2.170.0080.00822.96
8.2.160.0100.00319.52
8.2.150.0040.00424.18
8.2.140.0070.00024.66
8.2.130.0020.00522.09
8.2.120.0000.00726.35
8.2.110.0060.00319.27
8.2.100.0090.00317.78
8.2.90.0040.00417.88
8.2.80.0030.00618.04
8.2.70.0050.00317.92
8.2.60.0060.00317.80
8.2.50.0000.00818.10
8.2.40.0040.00420.60
8.2.30.0040.00419.20
8.2.20.0030.00817.71
8.2.10.0040.00417.95
8.2.00.0080.00017.66
8.1.330.0160.00422.24
8.1.320.0130.00616.32
8.1.310.0040.01116.66
8.1.300.0030.00620.43
8.1.290.0090.00030.84
8.1.280.0170.00425.92
8.1.270.0050.00523.93
8.1.260.0040.00428.09
8.1.250.0030.00528.09
8.1.240.0000.00822.52
8.1.230.0040.00719.12
8.1.220.0030.00517.74
8.1.210.0000.00918.77
8.1.200.0030.00617.35
8.1.190.0090.00017.35
8.1.180.0000.00818.10
8.1.170.0040.00718.77
8.1.160.0000.00722.18
8.1.150.0040.00418.76
8.1.140.0040.00419.52
8.1.130.0040.00417.71
8.1.120.0050.00217.31
8.1.110.0040.00417.45
8.1.100.0020.00517.36
8.1.90.0040.00417.43
8.1.80.0000.00717.38
8.1.70.0050.00317.43
8.1.60.0020.00517.53
8.1.50.0060.00317.45
8.1.40.0040.00417.59
8.1.30.0080.00017.66
8.1.20.0080.00017.60
8.1.10.0040.00417.59
8.1.00.0040.00417.42
8.0.300.0030.00320.00
8.0.290.0000.00816.75
8.0.280.0000.00718.35
8.0.270.0030.00317.20
8.0.260.0060.00316.83
8.0.250.0060.00016.86
8.0.240.0040.00416.96
8.0.230.0000.00717.01
8.0.220.0070.00016.84
8.0.210.0040.00416.78
8.0.200.0000.00716.93
8.0.190.0080.00016.93
8.0.180.0000.00716.88
8.0.170.0040.00416.92
8.0.160.0040.00416.89
8.0.150.0000.00816.73
8.0.140.0000.00816.93
8.0.130.0030.00313.34
8.0.120.0000.00716.82
8.0.110.0030.00816.77
8.0.100.0050.00316.86
8.0.90.0040.00316.69
8.0.80.0070.00716.96
8.0.70.0000.00716.86
8.0.60.0040.00416.73
8.0.50.0000.00716.70
8.0.30.0110.00716.97
8.0.20.0100.00917.40
8.0.10.0000.00816.90
8.0.00.0070.01716.62
7.4.330.0050.00015.08
7.4.320.0030.00316.45
7.4.300.0040.00416.62
7.4.290.0030.00316.63
7.4.280.0050.00616.52
7.4.270.0000.00716.59
7.4.260.0030.00316.46
7.4.250.0080.00016.62
7.4.240.0030.00316.55
7.4.230.0030.00316.43
7.4.220.0090.00916.50
7.4.210.0040.01116.48
7.4.200.0070.00016.60
7.4.160.0100.00716.64
7.4.150.0090.00917.40
7.4.140.0100.01017.86
7.4.130.0090.00816.49
7.4.120.0080.01216.53
7.4.110.0060.01216.41
7.4.100.0050.01416.67
7.4.90.0100.00716.62
7.4.80.0060.01519.39
7.4.70.0110.00616.57
7.4.60.0130.00316.57
7.4.50.0110.00316.40
7.4.40.0060.01216.44
7.4.30.0140.00616.46
7.4.00.0130.00315.12
7.3.330.0000.00613.08
7.3.320.0000.00613.12
7.3.310.0040.00416.32
7.3.300.0070.00016.18
7.3.290.0040.01016.31
7.3.280.0060.01216.27
7.3.270.0140.00317.40
7.3.260.0100.01116.33
7.3.250.0100.00916.28
7.3.240.0070.01116.54
7.3.230.0070.01416.41
7.3.210.0040.01416.34
7.3.200.0120.00616.40
7.3.190.0120.00316.37
7.3.180.0090.00616.35
7.3.170.0080.00816.52
7.3.160.0100.01316.67
7.2.330.0090.00916.48
7.2.320.0060.01516.34
7.2.310.0090.00916.47
7.2.300.0110.00716.77
7.2.290.0030.01316.67
7.2.60.0100.00316.77
7.2.00.0000.00919.45
7.1.200.0030.00715.78
7.1.100.0150.00418.09
7.1.70.0040.00717.11
7.1.60.0040.00816.84
7.1.50.0070.01516.86
7.1.00.0030.07722.57
7.0.200.0040.00714.94
7.0.100.0100.05320.07
7.0.90.0000.06719.99
7.0.80.0200.04720.12
7.0.70.0100.05319.99
7.0.60.0100.05319.97
7.0.50.0030.06320.39
7.0.40.0100.05320.38
7.0.30.0100.06020.46
7.0.20.0130.05720.38
7.0.10.0030.06020.45
7.0.00.0130.06020.34
5.6.250.0070.05720.67
5.6.240.0200.05020.78
5.6.230.0030.06320.66
5.6.220.0070.06020.75
5.6.210.0100.05320.75
5.6.200.0070.06021.19
5.6.190.0130.05321.19
5.6.180.0170.05021.14
5.6.170.0230.04021.22
5.6.160.0070.09021.15
5.6.150.0100.06321.16
5.6.140.0100.06021.14
5.6.130.0100.05721.15
5.6.120.0130.05721.12
5.6.110.0100.06021.21
5.6.100.0100.05321.07
5.6.90.0130.06021.17
5.6.80.0100.05720.48
5.6.70.0130.05020.52
5.6.60.0170.04720.54
5.6.50.0130.05720.67
5.6.40.0130.05020.57
5.6.30.0200.06020.47
5.6.20.0070.06320.58
5.6.10.0100.05320.52
5.6.00.0170.05020.51

preferences:
174.62 ms | 403 KiB | 5 Q