3v4l.org

run code in 300+ PHP versions simultaneously
<?php $key = 'password to (en/de)crypt'; $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', $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 ':' . "\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.0100.01018.43
8.3.50.0100.01022.04
8.3.40.0060.00918.58
8.3.30.0140.00018.71
8.3.20.0000.00720.33
8.3.10.0030.00520.61
8.3.00.0080.00021.88
8.2.180.0000.01518.29
8.2.170.0090.00622.96
8.2.160.0030.01022.16
8.2.150.0080.00024.18
8.2.140.0000.00724.66
8.2.130.0040.00421.05
8.2.120.0000.00826.35
8.2.110.0100.00022.30
8.2.100.0070.00417.67
8.2.90.0040.00419.09
8.2.80.0040.00417.97
8.2.70.0090.00017.63
8.2.60.0000.00817.91
8.2.50.0030.00518.09
8.2.40.0030.00520.43
8.2.30.0000.00819.37
8.2.20.0040.00417.70
8.2.10.0000.00718.07
8.2.00.0040.00417.95
8.1.280.0120.00925.92
8.1.270.0120.00622.13
8.1.260.0000.00828.09
8.1.250.0070.00028.09
8.1.240.0030.00623.81
8.1.230.0030.00917.52
8.1.220.0040.00417.79
8.1.210.0040.00418.77
8.1.200.0060.00317.35
8.1.190.0030.00617.22
8.1.180.0080.00018.10
8.1.170.0040.00418.51
8.1.160.0050.00320.68
8.1.150.0020.00518.84
8.1.140.0090.00019.40
8.1.130.0080.00017.66
8.1.120.0070.00017.30
8.1.110.0000.00717.31
8.1.100.0050.00317.37
8.1.90.0040.00417.38
8.1.80.0080.00017.26
8.1.70.0030.00317.31
8.1.60.0040.00417.42
8.1.50.0040.00417.50
8.1.40.0030.00617.49
8.1.30.0000.00917.70
8.1.20.0030.00517.53
8.1.10.0110.00017.49
8.1.00.0000.00717.57
8.0.300.0050.00218.77
8.0.290.0000.00716.75
8.0.280.0050.00218.38
8.0.270.0030.00317.20
8.0.260.0000.00617.20
8.0.250.0000.00717.04
8.0.240.0040.00416.95
8.0.230.0030.00416.95
8.0.220.0040.00416.79
8.0.210.0030.00316.85
8.0.200.0060.00016.85
8.0.190.0030.00516.85
8.0.180.0050.00216.82
8.0.170.0000.00816.79
8.0.160.0000.00716.97
8.0.150.0070.00016.89
8.0.140.0040.00416.80
8.0.130.0000.00613.34
8.0.120.0030.00516.88
8.0.110.0050.00216.93
8.0.100.0000.00816.96
8.0.90.0000.00716.84
8.0.80.0040.01116.86
8.0.70.0040.00416.83
8.0.60.0070.00016.91
8.0.50.0030.00616.73
8.0.30.0090.01216.98
8.0.20.0150.00717.40
8.0.10.0000.00717.04
8.0.00.0080.01016.79
7.4.330.0050.00016.71
7.4.320.0030.00316.47
7.4.300.0050.00216.50
7.4.290.0000.00716.59
7.4.280.0000.00716.61
7.4.270.0070.00016.41
7.4.260.0000.00816.49
7.4.250.0000.00716.57
7.4.240.0000.00716.47
7.4.230.0070.00016.62
7.4.220.0030.01416.55
7.4.210.0060.00916.58
7.4.200.0070.00016.36
7.4.160.0090.00616.59
7.4.150.0120.01217.40
7.4.140.0070.01017.86
7.4.130.0080.00916.48
7.4.120.0120.00516.50
7.4.110.0160.00316.64
7.4.100.0100.00716.65
7.4.90.0030.01216.59
7.4.80.0110.00619.39
7.4.70.0060.00916.59
7.4.60.0100.01316.56
7.4.50.0110.00616.36
7.4.40.0040.01216.42
7.4.30.0100.00616.42
7.4.00.0070.00714.79
7.3.330.0050.00013.16
7.3.320.0030.00313.12
7.3.310.0070.00016.15
7.3.300.0000.00616.20
7.3.290.0000.00716.31
7.3.280.0100.00916.27
7.3.270.0060.01617.40
7.3.260.0100.00716.44
7.3.250.0110.00616.32
7.3.240.0090.00916.45
7.3.230.0030.01416.50
7.3.210.0030.01316.34
7.3.200.0130.00716.50
7.3.190.0120.00416.54
7.3.180.0110.00616.63
7.3.170.0070.01016.59
7.3.160.0030.01216.30
7.2.330.0060.01916.48
7.2.320.0120.00616.44
7.2.310.0050.01216.50
7.2.300.0070.01016.37
7.2.290.0060.01016.34
7.2.80.0000.01216.54
7.2.60.0030.00716.51
7.2.00.0090.00919.29
7.1.200.0000.00915.72
7.1.100.0130.00317.80
7.1.70.0000.00817.09
7.1.60.0000.02419.19
7.1.50.0100.00616.89
7.1.00.0100.07022.27
7.0.200.0440.01314.61
7.0.60.0130.06321.82
7.0.50.0030.04717.89
7.0.40.0100.08720.07
7.0.30.0500.07020.04
7.0.20.0230.05320.18
7.0.10.0070.04020.23
7.0.00.0070.04020.18
5.6.280.0000.03721.13
5.6.210.0130.07320.57
5.6.200.0030.04318.19
5.6.190.0170.04320.49
5.6.180.0300.05320.49
5.6.170.0270.08320.55
5.6.160.0070.08320.43
5.6.150.0030.08318.17
5.6.140.0000.04318.21
5.6.130.0030.07718.12
5.6.120.0000.04721.06
5.6.110.0130.07720.92
5.6.100.0070.06721.18
5.6.90.0070.08321.11
5.6.80.0100.07720.29
5.5.350.0370.07020.45
5.5.340.0100.07017.91
5.5.330.0070.06320.21
5.5.320.0570.07320.18
5.5.310.0270.06320.32
5.5.300.0070.07317.89
5.5.290.0100.06317.88
5.5.280.0000.05721.07
5.5.270.0030.09020.81
5.5.260.0070.07320.68
5.5.250.0030.04020.66
5.5.240.0030.05320.31

preferences:
60.17 ms | 401 KiB | 5 Q