3v4l.org

run code in 300+ PHP versions simultaneously
<?php $key = 'password to (en/de)cryptg'; $string = ' string to be encryptedg '; // 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', $key, 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', $key, 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.3.60.0060.01516.75
8.3.50.0110.00721.09
8.3.40.0100.00318.92
8.3.30.0090.00918.67
8.3.20.0090.00020.30
8.3.10.0070.00021.82
8.3.00.0000.00721.73
8.2.180.0100.00718.29
8.2.170.0110.00422.96
8.2.160.0080.00520.57
8.2.150.0040.00424.18
8.2.140.0000.00724.66
8.2.130.0030.00620.76
8.2.120.0060.00326.35
8.2.110.0120.00020.57
8.2.100.0060.00617.78
8.2.90.0040.00419.05
8.2.80.0030.00617.97
8.2.70.0040.00417.50
8.2.60.0080.00017.79
8.2.50.0040.00418.09
8.2.40.0070.00020.60
8.2.30.0000.00819.36
8.2.20.0050.00317.69
8.2.10.0040.00418.13
8.2.00.0020.00517.95
8.1.280.0210.00025.92
8.1.270.0140.00022.14
8.1.260.0070.00028.09
8.1.250.0040.00428.09
8.1.240.0070.00323.97
8.1.230.0000.01220.97
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0030.00617.23
8.1.190.0000.00817.25
8.1.180.0050.00318.10
8.1.170.0000.00818.65
8.1.160.0000.00720.76
8.1.150.0080.00020.59
8.1.140.0060.00319.53
8.1.130.0000.00717.59
8.1.120.0020.00517.41
8.1.110.0040.00417.23
8.1.100.0000.00717.44
8.1.90.0040.00417.40
8.1.80.0000.00817.46
8.1.70.0000.00717.31
8.1.60.0030.00517.59
8.1.50.0040.00417.53
8.1.40.0050.00517.54
8.1.30.0000.00917.57
8.1.20.0000.00717.56
8.1.10.0000.00817.59
8.1.00.0030.00617.54
8.0.300.0030.00518.77
8.0.290.0030.00716.58
8.0.280.0050.00218.32
8.0.270.0050.00217.13
8.0.260.0000.00617.12
8.0.250.0030.00316.88
8.0.240.0000.00616.93
8.0.230.0000.00716.88
8.0.220.0040.00416.88
8.0.210.0030.00316.97
8.0.200.0050.00216.96
8.0.190.0040.00417.01
8.0.180.0070.00416.99
8.0.170.0000.00716.96
8.0.160.0030.00316.80
8.0.150.0000.00716.73
8.0.140.0000.01016.81
8.0.130.0030.00313.35
8.0.120.0080.00016.88
8.0.110.0040.00416.82
8.0.100.0070.00016.78
8.0.90.0000.00716.71
8.0.80.0130.00716.97
8.0.70.0040.00416.79
8.0.60.0050.00316.77
8.0.50.0070.00016.98
8.0.30.0080.01016.97
8.0.20.0070.01117.40
8.0.10.0040.00416.89
8.0.00.0050.01316.88
7.4.330.0060.00016.67
7.4.320.0000.00616.58
7.4.300.0060.00016.61
7.4.290.0030.00316.58
7.4.280.0040.00416.54
7.4.270.0030.00316.54
7.4.260.0070.00016.57
7.4.250.0060.00316.57
7.4.240.0030.00316.53
7.4.230.0030.00516.56
7.4.220.0060.01216.64
7.4.210.0090.00916.62
7.4.200.0000.00716.70
7.4.160.0060.00916.71
7.4.150.0060.01217.40
7.4.140.0110.01017.86
7.4.130.0060.01016.47
7.4.120.0070.01016.46
7.4.110.0110.00716.59
7.4.100.0090.01116.66
7.4.90.0060.01116.39
7.4.80.0090.00919.39
7.4.70.0040.01216.38
7.4.60.0090.00616.60
7.4.50.0030.01416.48
7.4.40.0100.00716.52
7.4.30.0100.01316.71
7.4.00.0080.00815.22
7.3.330.0040.00413.25
7.3.320.0030.00313.01
7.3.310.0000.00716.10
7.3.300.0030.00316.28
7.3.290.0090.00716.34
7.3.280.0060.00916.32
7.3.270.0080.01117.40
7.3.260.0110.00616.47
7.3.250.0080.01116.38
7.3.240.0070.01016.51
7.3.230.0100.00716.39
7.3.210.0070.01016.48
7.3.200.0090.01119.39
7.3.190.0090.00616.24
7.3.180.0030.01316.45
7.3.170.0120.00816.63
7.3.160.0120.00416.26
7.2.330.0140.00316.43
7.2.320.0160.00016.55
7.2.310.0070.01016.54
7.2.300.0060.01216.48
7.2.290.0080.01116.37
7.2.60.0100.00716.80
7.2.00.0030.00719.05
7.1.200.0060.00315.73
7.1.100.0040.00718.11
7.1.70.0050.00216.93
7.1.60.0100.01319.40
7.1.50.0070.01416.86
7.1.00.0070.07322.36
7.0.200.0420.00614.65
7.0.60.0370.07319.89
7.0.50.0100.06017.91
7.0.40.0130.03720.05
7.0.30.0330.05720.18
7.0.20.0300.06720.24
7.0.10.0000.05320.21
7.0.00.0000.07720.16
5.6.210.0130.03720.48
5.6.200.0100.06718.21
5.6.190.0100.04320.44
5.6.180.0200.06320.40
5.6.170.0370.06020.55
5.6.160.0130.05720.55
5.6.150.0000.07718.28
5.6.140.0070.07018.17
5.6.130.0070.03718.21
5.6.120.0170.07021.04
5.6.110.0030.04321.16
5.6.100.0130.07720.92
5.6.90.0130.07721.14
5.6.80.0070.08020.42
5.5.350.0270.03320.31
5.5.340.0070.05717.99
5.5.330.0000.04320.40
5.5.320.0400.07020.29
5.5.310.0300.04720.21
5.5.300.0070.08317.89
5.5.290.0070.07017.88
5.5.280.0030.04321.05
5.5.270.0070.04020.91
5.5.260.0200.06720.88
5.5.250.0100.05320.70
5.5.240.0230.06020.23

preferences:
61.83 ms | 401 KiB | 5 Q