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 '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.4.20.0100.01018.05
8.4.10.0030.00617.89
8.3.150.0040.01120.77
8.3.140.0090.00918.27
8.3.130.0000.00818.43
8.3.120.0100.01020.39
8.3.110.0040.00416.38
8.3.100.0080.00024.06
8.3.90.0090.00626.77
8.3.80.0070.00716.63
8.3.70.0200.01317.28
8.3.60.0110.00416.50
8.3.50.0100.01121.92
8.3.40.0100.00718.88
8.3.30.0050.01421.05
8.3.20.0090.00421.63
8.3.10.0110.00622.79
8.3.00.0080.00721.21
8.2.260.0090.00916.63
8.2.250.0040.00416.63
8.2.240.0060.01219.21
8.2.230.0000.00920.94
8.2.220.0030.00637.54
8.2.210.0050.00326.77
8.2.200.0080.00016.63
8.2.190.0040.01816.58
8.2.180.0130.00825.92
8.2.170.0140.00318.87
8.2.160.0140.00322.96
8.2.150.0060.00724.31
8.2.140.0090.00623.16
8.2.130.0050.01121.83
8.2.120.0080.00621.31
8.2.110.0110.00521.22
8.2.100.0080.00819.95
8.2.90.0080.00820.52
8.2.80.0090.00720.47
8.2.70.0090.00728.72
8.2.60.0110.00540.01
8.2.50.0080.00625.44
8.2.40.0130.00326.73
8.2.30.0100.00725.22
8.2.20.0110.00525.65
8.2.10.0090.00625.67
8.2.00.0100.00524.56
8.1.310.0140.00318.25
8.1.300.0040.00417.91
8.1.290.0090.00018.88
8.1.280.0130.01025.92
8.1.270.0090.00523.61
8.1.260.0040.00822.04
8.1.250.0060.00622.02
8.1.240.0070.00620.67
8.1.230.0090.00720.81
8.1.220.0110.00420.04
8.1.210.0060.00920.30
8.1.200.0110.00428.29
8.1.190.0100.00528.34
8.1.180.0090.00626.46
8.1.170.0100.00725.77
8.1.160.0110.00525.70
8.1.150.0100.00624.51
8.1.140.0080.00625.46
8.1.130.0080.00625.50
8.1.120.0080.00523.75
8.1.110.0090.00623.71
8.1.100.0120.00323.84
8.1.90.0100.00423.26
8.1.80.0090.00523.27
8.1.70.0080.00522.98
8.1.60.0100.00522.96
8.1.50.0080.00622.01
8.1.40.0110.00422.04
8.1.30.0120.00322.67
8.1.20.0100.00522.38
8.1.10.0090.00722.43
8.1.00.0100.00522.03
8.0.300.0060.00519.80
8.0.290.0100.00439.36
8.0.280.0120.00325.34
8.0.270.0080.00425.20
8.0.260.0110.00325.16
8.0.250.0090.00424.09
8.0.240.0120.00323.38
8.0.230.0110.00422.89
8.0.220.0100.00323.00
8.0.210.0100.00522.85
8.0.200.0110.00422.51
8.0.190.0090.00522.51
8.0.180.0090.00422.22
8.0.170.0100.00521.65
8.0.160.0090.00522.13
8.0.150.0100.00521.79
8.0.140.0100.00521.79
8.0.130.0100.00521.57
8.0.120.0120.00321.78
8.0.110.0090.00521.63
8.0.100.0100.00421.03
8.0.90.0090.00521.07
8.0.80.0090.00521.07
8.0.70.0080.00521.14
8.0.60.0100.00421.06
8.0.50.0080.00621.07
8.0.30.0100.00619.96
8.0.20.0100.00719.53
8.0.10.0120.00619.54
8.0.00.0110.00818.88
7.4.330.0070.00421.82
7.4.320.0130.00322.22
7.4.300.0110.00522.24
7.4.290.0120.00421.88
7.4.280.0130.00521.91
7.4.270.0140.00321.60
7.4.260.0140.00521.57
7.4.250.0170.00421.53
7.4.240.0110.00520.81
7.4.230.0120.00420.47
7.4.220.0100.00620.79
7.4.210.0130.00320.85
7.4.200.0110.00420.82
7.4.190.0120.00421.12
7.4.180.0120.00521.03
7.4.160.0120.00520.13
7.4.150.0120.00719.25
7.4.140.0120.00619.09
7.4.130.0110.00818.48
7.4.120.0120.00718.47
7.4.110.0120.00718.18
7.4.100.0120.00817.99
7.4.90.0120.00817.83
7.4.80.0100.00817.78
7.4.70.0110.00917.64
7.4.60.0110.00717.55
7.4.50.0110.00817.46
7.4.40.0110.00717.38
7.4.30.0100.00917.38
7.4.20.0100.00817.36
7.4.10.0100.00917.19
7.4.00.0100.00817.16
7.3.330.0120.00521.22
7.3.320.0130.00521.19
7.3.310.0130.00521.10
7.3.300.0120.00320.24
7.3.290.0110.00519.89
7.3.280.0100.00620.05
7.3.270.0130.00519.35
7.3.260.0120.00618.96
7.3.250.0120.00718.45
7.3.240.0120.00718.32
7.3.230.0120.00818.04
7.3.220.0130.00817.81
7.3.210.0130.00717.68
7.3.200.0120.00817.62
7.3.190.0110.00817.49
7.3.180.0120.00817.40
7.3.170.0120.00817.36
7.3.160.0120.00717.26
7.3.150.0110.00817.25
7.3.140.0110.00817.19
7.3.130.0120.00817.29
7.3.120.0110.00816.90
7.3.110.0100.00816.79
7.3.100.0110.00816.67
7.3.90.0110.00816.58
7.3.80.0100.00916.49
7.3.70.0100.00816.36
7.3.60.0110.00816.33
7.3.50.0100.00816.32
7.3.40.0100.00816.29
7.3.30.0110.00716.31
7.3.20.0120.00816.59
7.3.10.0130.00816.51
7.3.00.0150.00716.44
7.2.340.0150.00818.11
7.2.330.0140.00917.74
7.2.320.0150.00817.65
7.2.310.0130.00917.49
7.2.300.0130.00817.47
7.2.290.0120.00917.30
7.2.280.0140.00817.31
7.2.270.0130.00917.26
7.2.260.0130.00817.16
7.2.250.0130.00817.10
7.2.240.0120.00916.89
7.2.230.0120.00816.77
7.2.220.0120.00916.63
7.2.210.0110.00916.56
7.2.200.0120.00916.48
7.2.190.0130.00816.46
7.2.180.0110.00916.43
7.2.170.0120.00816.43
7.2.160.0110.00916.43
7.2.150.0140.00916.73
7.2.140.0140.00916.73
7.2.130.0160.00916.63
7.2.120.0210.00916.62
7.2.110.0160.00816.61
7.2.100.0170.00916.58
7.2.90.0200.00916.61
7.2.80.0180.00816.59
7.2.70.0180.00916.59
7.2.60.0160.00816.58
7.2.50.0170.00816.60
7.2.40.0170.00816.63
7.2.30.0160.00916.63
7.2.20.0180.00916.60
7.2.10.0170.00916.60
7.2.00.0170.00816.60
7.1.330.0180.00916.14
7.1.320.0170.00815.89
7.1.310.0170.00815.82
7.1.300.0160.00815.69
7.1.290.0150.00815.71
7.1.280.0150.00815.67
7.1.270.0160.00715.67
7.1.260.0150.00815.66
7.1.250.0230.00815.54
7.1.240.0210.00815.52
7.1.230.0200.00815.51
7.1.220.0210.00815.51
7.1.210.0210.00815.49
7.1.200.0200.00815.51
7.1.190.0210.00815.49
7.1.180.0200.00815.49
7.1.170.0200.00815.49
7.1.160.0210.00815.50
7.1.150.0220.00815.50
7.1.140.0210.00815.52
7.1.130.0200.00815.50
7.1.120.0210.00815.50
7.1.110.0200.00815.53
7.1.100.0200.00815.52
7.1.90.0220.00815.53
7.1.80.0200.00815.54
7.1.70.0190.00815.54
7.1.60.0190.00815.77
7.1.50.0180.00915.75
7.1.40.0190.00815.75
7.1.30.0190.00815.76
7.1.20.0210.00815.76
7.1.10.0190.00815.54
7.1.00.0180.00815.51
7.0.330.0200.00815.26
7.0.320.0180.00815.28
7.0.310.0200.00815.24
7.0.300.0200.00815.24
7.0.290.0200.00815.25
7.0.280.0200.00815.24
7.0.270.0210.00815.26
7.0.260.0200.00815.25
7.0.250.0200.00815.29
7.0.240.0210.00915.33
7.0.230.0190.00815.33
7.0.220.0200.00715.31
7.0.210.0210.00715.30
7.0.200.0190.00815.29
7.0.190.0200.00815.29
7.0.180.0200.00815.31
7.0.170.0190.00715.30
7.0.160.0200.00815.32
7.0.150.0180.00815.30
7.0.140.0200.00815.31
7.0.130.0180.00815.32
7.0.120.0180.00915.32
7.0.110.0170.00815.30
7.0.100.0190.00715.29
7.0.90.0190.00715.37
7.0.80.0180.00815.31
7.0.70.0190.00815.29
7.0.60.0190.00815.32
7.0.50.0200.00715.33
7.0.40.0180.00715.30
7.0.30.0190.00815.31
7.0.20.0190.00815.27
7.0.10.0190.00815.31
7.0.00.0180.00815.38
5.6.400.0140.01015.76
5.6.390.0150.00915.79
5.6.380.0150.00815.66
5.6.370.0150.01015.68
5.6.360.0140.01015.65
5.6.350.0160.00815.69
5.6.340.0140.01015.65
5.6.330.0150.00915.65
5.6.320.0150.00915.66
5.6.310.0140.00915.64
5.6.300.0150.00915.66
5.6.290.0150.00915.64
5.6.280.0150.00915.64
5.6.270.0150.01015.67
5.6.260.0150.00915.65
5.6.250.0140.00915.63
5.6.240.0140.00915.63
5.6.230.0150.00915.65
5.6.220.0140.01015.65
5.6.210.0150.00915.63
5.6.200.0140.00915.63
5.6.190.0150.00915.66
5.6.180.0150.00915.62
5.6.170.0150.00915.62
5.6.160.0140.01015.61
5.6.150.0150.00915.62
5.6.140.0150.00915.61
5.6.130.0150.00915.63
5.6.120.0150.00915.63
5.6.110.0150.00915.62
5.6.100.0150.00915.62
5.6.90.0150.00915.63
5.6.80.0140.00915.56
5.6.70.0140.01015.57
5.6.60.0140.00915.55
5.6.50.0140.00915.54
5.6.40.0140.00915.57
5.6.30.0140.00915.83
5.6.20.0140.01015.54
5.6.10.0150.00915.54
5.6.00.0140.00915.54
5.5.380.0150.00915.35
5.5.370.0150.00915.33
5.5.360.0150.00915.28
5.5.350.0150.00915.30
5.5.340.0150.00915.30
5.5.330.0160.00915.29
5.5.320.0150.00915.29
5.5.310.0150.00915.30
5.5.300.0150.00915.30
5.5.290.0150.00915.29
5.5.280.0150.00915.30
5.5.270.0150.00915.26
5.5.260.0150.00915.24
5.5.250.0140.00915.22
5.5.240.0150.00915.22
5.5.230.0140.00915.22
5.5.220.0150.00915.21
5.5.210.0140.00915.24
5.5.200.0140.00915.21
5.5.190.0140.00915.19
5.5.180.0140.00915.20
5.5.170.0150.00915.28
5.5.160.0140.00915.23
5.5.150.0150.00915.23
5.5.140.0150.00915.20
5.5.130.0150.00915.20
5.5.120.0150.00915.20
5.5.110.0150.00915.21
5.5.100.0140.01015.21
5.5.90.0140.00915.21
5.5.80.0140.00915.21
5.5.70.0150.00915.21
5.5.60.0140.00915.22
5.5.50.0140.00915.19
5.5.40.0140.00915.20
5.5.30.0150.00915.21
5.5.20.0140.00915.20
5.5.10.0140.00915.20
5.5.00.0140.00915.18
5.4.450.0120.00612.86
5.4.440.0120.00712.86
5.4.430.0110.00712.85
5.4.420.0120.00712.84
5.4.410.0120.00712.87
5.4.400.0120.00612.82
5.4.390.0120.00712.80
5.4.380.0120.00712.81
5.4.370.0120.00612.80
5.4.360.0120.00712.81
5.4.350.0120.00712.81
5.4.340.0120.00712.80
5.4.330.0120.00712.80
5.4.320.0120.00612.81
5.4.310.0110.00712.81
5.4.300.0120.00712.81
5.4.290.0120.00712.82
5.4.280.0120.00712.80
5.4.270.0110.00712.81
5.4.260.0120.00712.81
5.4.250.0120.00712.81
5.4.240.0120.00612.80
5.4.230.0120.00712.79
5.4.220.0120.00612.78
5.4.210.0120.00612.78
5.4.200.0120.00712.78
5.4.190.0120.00712.78
5.4.180.0120.00612.78
5.4.170.0110.00712.78
5.4.160.0120.00612.79
5.4.150.0110.00712.78
5.4.140.0110.00712.82
5.4.130.0120.00612.83
5.4.120.0110.00712.82
5.4.110.0120.00712.81
5.4.100.0120.00612.82
5.4.90.0120.00612.81
5.4.80.0110.00612.82
5.4.70.0120.00612.81
5.4.60.0110.00612.82
5.4.50.0110.00712.81
5.4.40.0110.00712.82
5.4.30.0110.00712.82
5.4.20.0120.00612.81
5.4.10.0110.00712.82
5.4.00.0110.00712.79
5.3.290.0030.00622.96
5.3.280.0030.00622.96
5.3.270.0100.00022.96
5.3.260.0000.00922.96
5.3.250.0000.01022.96
5.3.240.0060.00322.96
5.3.230.0100.00022.96
5.3.220.0050.00522.96
5.3.210.0030.00622.96
5.3.200.0050.00522.96
5.3.190.0060.00322.96
5.3.180.0060.00322.96
5.3.170.0060.00322.96
5.3.160.0030.00622.96
5.3.150.0050.00522.96
5.3.140.0030.00722.96
5.3.130.0060.00322.96
5.3.120.0030.00722.96
5.3.110.0080.00322.96
5.3.100.0090.00522.96
5.3.90.0120.00022.96
5.3.80.0060.00322.96
5.3.70.0030.00622.96
5.3.60.0030.00622.96
5.3.50.0000.00922.96
5.3.40.0050.00522.96
5.3.30.0030.00722.96
5.3.20.0030.00622.96
5.3.10.0050.00522.96
5.3.00.0070.00322.96
5.2.170.0040.00422.96
5.2.160.0060.00322.96
5.2.150.0030.00622.96
5.2.140.0030.00722.96
5.2.130.0090.00022.96
5.2.120.0070.00322.96
5.2.110.0070.00422.96
5.2.100.0030.00622.96
5.2.90.0030.00722.96
5.2.80.0070.00422.96
5.2.70.0080.00422.96
5.2.60.0080.00322.96
5.2.50.0000.01222.96
5.2.40.0100.00022.96
5.2.30.0100.00522.96
5.2.20.0100.00622.96
5.2.10.0090.00622.96
5.2.00.0140.00022.96
5.1.60.0130.00022.96
5.1.50.0060.00622.96
5.1.40.0100.00322.96
5.1.30.0140.00022.96
5.1.20.0070.00722.96
5.1.10.0130.00022.96
5.1.00.0090.00422.96
5.0.50.0090.00222.96
5.0.40.0080.00422.96
5.0.30.0000.01122.96
5.0.20.0000.01122.96
5.0.10.0000.01122.96
5.0.00.0100.00022.96
4.4.90.0070.00022.96
4.4.80.0060.00022.96
4.4.70.0070.00022.96
4.4.60.0070.00022.96
4.4.50.0070.00022.96
4.4.40.0060.00022.96
4.4.30.0060.00022.96
4.4.20.0060.00022.96
4.4.10.0030.00322.96
4.4.00.0070.00022.96
4.3.110.0060.00022.96
4.3.100.0040.00222.96
4.3.90.0070.00022.96
4.3.80.0060.00022.96
4.3.70.0040.00222.96
4.3.60.0040.00422.96
4.3.50.0060.00022.96
4.3.40.0040.00222.96
4.3.30.0000.00522.96
4.3.20.0050.00022.96
4.3.10.0050.00022.96
4.3.00.0050.00022.96

preferences:
82.92 ms | 403 KiB | 5 Q