3v4l.org

run code in 300+ PHP versions simultaneously
<?php $key = 'password to (en/de)crypt'; $string = ' Hi it sme '; // 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.0130.00318.56
8.3.50.0040.01116.15
8.3.40.0070.00718.79
8.3.30.0070.00718.59
8.3.20.0030.00519.10
8.3.10.0080.00023.58
8.3.00.0060.00318.09
8.2.180.0070.01418.45
8.2.170.0110.01122.96
8.2.160.0070.01020.43
8.2.150.0040.00425.66
8.2.140.0000.00824.66
8.2.130.0000.00820.52
8.2.120.0090.00626.35
8.2.110.0060.00320.51
8.2.100.0090.00317.91
8.2.90.0040.00419.23
8.2.80.0040.00418.05
8.2.70.0000.00817.60
8.2.60.0030.00617.90
8.2.50.0000.00818.10
8.2.40.0050.00222.20
8.2.30.0040.00420.94
8.2.20.0050.00217.93
8.2.10.0040.00418.06
8.2.00.0080.00018.05
8.1.280.0140.00725.92
8.1.270.0040.00423.91
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0000.00922.56
8.1.230.0070.00419.16
8.1.220.0000.00817.77
8.1.210.0040.00418.77
8.1.200.0060.00317.36
8.1.190.0000.00817.35
8.1.180.0030.00518.10
8.1.170.0040.00418.46
8.1.160.0000.00719.07
8.1.150.0070.00018.75
8.1.140.0040.00421.29
8.1.130.0040.00418.89
8.1.120.0000.00717.43
8.1.110.0030.00617.42
8.1.100.0020.00517.43
8.1.90.0060.00317.34
8.1.80.0030.00517.38
8.1.70.0060.00317.46
8.1.60.0040.00417.42
8.1.50.0040.00417.45
8.1.40.0070.00017.55
8.1.30.0000.00717.69
8.1.20.0080.00017.61
8.1.10.0000.00817.54
8.1.00.0040.00417.55
8.0.300.0000.00718.77
8.0.290.0040.00416.75
8.0.280.0000.00818.29
8.0.270.0000.00717.17
8.0.260.0030.00316.74
8.0.250.0000.00716.96
8.0.240.0000.00716.88
8.0.230.0030.00317.03
8.0.220.0000.00716.82
8.0.210.0050.00216.94
8.0.200.0000.00716.95
8.0.190.0000.00816.86
8.0.180.0040.00416.82
8.0.170.0030.00516.81
8.0.160.0000.00816.86
8.0.150.0080.00016.75
8.0.140.0000.00716.86
8.0.130.0030.00313.35
8.0.120.0050.00316.91
8.0.110.0040.00416.88
8.0.100.0050.00316.68
8.0.90.0000.00716.89
8.0.80.0100.00716.85
8.0.70.0080.00016.78
8.0.60.0050.00216.81
8.0.50.0080.00016.91
8.0.30.0130.00817.10
8.0.20.0090.01217.40
8.0.10.0030.00417.07
8.0.00.0060.01216.73
7.4.330.0040.00015.55
7.4.320.0030.00316.42
7.4.300.0080.00016.54
7.4.290.0030.00316.41
7.4.280.0060.00316.41
7.4.270.0090.00016.53
7.4.260.0000.00713.28
7.4.250.0000.00816.50
7.4.240.0030.00416.52
7.4.230.0070.00016.61
7.4.220.0130.01316.63
7.4.210.0040.01116.56
7.4.200.0050.00316.62
7.4.160.0040.01016.52
7.4.150.0090.00917.40
7.4.140.0110.01217.86
7.4.130.0100.01016.52
7.4.120.0110.00816.47
7.4.110.0030.01416.44
7.4.100.0120.00816.39
7.4.90.0140.00816.56
7.4.80.0110.00619.39
7.4.70.0100.01016.74
7.4.60.0120.00316.44
7.4.50.0100.00316.22
7.4.40.0130.00416.68
7.4.30.0000.01716.66
7.3.330.0000.00713.09
7.3.320.0000.00513.18
7.3.310.0070.00016.18
7.3.300.0040.00416.27
7.3.290.0060.00816.29
7.3.280.0090.00816.28
7.3.270.0060.01317.40
7.3.260.0080.00816.54
7.3.250.0110.00716.24
7.3.240.0070.01016.29
7.3.230.0090.00916.42
7.3.210.0130.00316.47
7.3.200.0110.00616.18
7.3.190.0160.00016.16
7.3.180.0080.01216.55
7.3.170.0080.00816.26
7.3.160.0140.00316.41
7.2.330.0000.02216.62
7.2.320.0080.01116.54
7.2.310.0090.00916.70
7.2.300.0070.01716.54
7.2.290.0030.01316.26

preferences:
32.97 ms | 400 KiB | 5 Q