3v4l.org

run code in 300+ PHP versions simultaneously
<?php function encrypt($decrypted, $password, $salt='123456789') { $key = hash('SHA256', $salt . $password, true); srand(); $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC), MCRYPT_RAND); if (strlen($iv_base64 = rtrim(base64_encode($iv), '=')) != 22) return false; $encrypted = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $decrypted . md5($decrypted), MCRYPT_MODE_CBC, $iv)); return $iv_base64 . $encrypted; } function decrypt($encrypted, $password, $salt='123456789') { $key = hash('SHA256', $salt . $password, true); $iv = base64_decode(substr($encrypted, 0, 22) . '=='); $encrypted = substr($encrypted, 22); $decrypted = rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $key, base64_decode($encrypted), MCRYPT_MODE_CBC, $iv), "\0\4"); $hash = substr($decrypted, -32); $decrypted = substr($decrypted, 0, -32); if (md5($decrypted) != $hash) return false; return $decrypted; } print_r (encrypt(" mi texto","asdf")); echo "\n"; print_r ("= " + decrypt(encrypt(" mi texto","asdf"),"asdf")); echo "\n";

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.0080.01116.84
8.5.00.0130.00920.43
8.4.150.0030.00014.05
8.4.140.0190.00620.20
8.4.130.0130.00717.88
8.4.120.0030.00520.66
8.4.110.0120.00922.45
8.4.100.0120.00817.76
8.4.90.0040.00518.16
8.4.80.0120.00819.77
8.4.70.0130.00819.88
8.4.60.0110.00919.76
8.4.50.0130.00820.60
8.4.40.0130.00719.91
8.4.30.0050.00319.84
8.4.20.0170.00319.71
8.4.10.0100.00718.07
8.3.280.0070.01318.48
8.3.270.0130.00816.62
8.3.260.0140.00616.46
8.3.250.0050.00418.94
8.3.240.0090.01116.56
8.3.230.0120.00916.53
8.3.220.0090.01118.68
8.3.210.0110.00816.42
8.3.200.0110.00716.71
8.3.190.0100.01017.26
8.3.180.0120.00618.91
8.3.170.0120.00617.21
8.3.160.0100.00716.82
8.3.150.0110.00717.13
8.3.140.0060.00316.55
8.3.130.0070.00316.61
8.3.120.0160.00020.56
8.3.110.0100.00020.94
8.3.100.0110.00718.42
8.3.90.0040.01126.77
8.3.80.0100.00019.36
8.3.70.0090.00618.27
8.3.60.0070.01016.75
8.3.50.0090.00717.65
8.3.40.0110.00418.82
8.3.30.0070.00718.86
8.3.20.0080.00021.91
8.3.10.0040.00421.77
8.3.00.0050.00319.68
8.2.290.0100.00820.40
8.2.280.0120.00816.71
8.2.270.0090.00916.95
8.2.260.0070.01118.92
8.2.250.0060.00318.41
8.2.240.0040.00717.32
8.2.230.0040.00722.58
8.2.220.0030.00624.06
8.2.210.0040.00426.77
8.2.200.0040.00418.88
8.2.190.0040.01118.21
8.2.180.0150.00318.41
8.2.170.0070.01522.96
8.2.160.0070.01020.43
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00420.51
8.2.120.0060.00326.35
8.2.110.0060.00320.38
8.2.100.0040.00817.91
8.2.90.0100.00017.78
8.2.80.0080.00017.97
8.2.70.0090.00018.03
8.2.60.0040.00717.75
8.2.50.0040.00418.10
8.2.40.0030.00522.37
8.2.30.0050.00321.14
8.2.20.0040.00417.95
8.2.10.0000.00718.07
8.2.00.0000.00718.05
8.1.330.0130.00521.75
8.1.320.0090.01016.39
8.1.310.0150.00016.63
8.1.300.0040.00416.43
8.1.290.0000.00930.84
8.1.280.0040.01125.92
8.1.270.0070.00023.99
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00623.83
8.1.230.0070.00721.04
8.1.220.0080.00017.74
8.1.210.0070.00419.16
8.1.200.0040.00417.35
8.1.190.0050.00317.35
8.1.180.0000.00718.10
8.1.170.0040.00418.43
8.1.160.0040.00418.83
8.1.150.0040.00420.14
8.1.140.0000.00717.63
8.1.130.0000.00717.34
8.1.120.0070.00017.41
8.1.110.0000.00717.28
8.1.100.0030.00617.40
8.1.90.0000.00817.43
8.1.80.0050.00317.43
8.1.70.0040.00417.30
8.1.60.0030.00917.48
8.1.50.0000.00817.54
8.1.40.0080.00017.51
8.1.30.0030.00517.63
8.1.20.0030.00617.62
8.1.10.0000.00717.64
8.1.00.0040.00417.38
8.0.300.0070.00020.20
8.0.290.0030.00616.75
8.0.280.0080.00018.45
8.0.270.0000.00717.14
8.0.260.0000.00616.90
8.0.250.0040.00417.07
8.0.240.0070.00017.00
8.0.230.0040.00316.95
8.0.220.0000.00716.98
8.0.210.0070.00016.94
8.0.200.0000.00716.91
8.0.190.0040.00716.99
8.0.180.0000.00816.88
8.0.170.0090.00016.96
8.0.160.0050.00316.98
8.0.150.0040.00416.98
8.0.140.0000.00716.96
8.0.130.0050.00013.33
8.0.120.0000.00816.91
8.0.110.0040.00417.03
8.0.100.0040.00416.75
8.0.90.0050.00216.89
8.0.80.0090.01316.98
8.0.70.0070.00016.79
8.0.60.0040.00416.86
8.0.50.0030.00516.91
8.0.30.0100.01017.06
8.0.20.0100.00817.41
8.0.10.0000.00717.07
8.0.00.0120.00716.75
7.4.330.0000.00515.55
7.4.320.0000.00716.58
7.4.300.0000.00616.53
7.4.290.0070.00016.51
7.4.280.0000.00716.43
7.4.270.0070.00016.58
7.4.260.0030.00616.48
7.4.250.0050.00216.41
7.4.240.0000.00716.41
7.4.230.0000.00716.69
7.4.220.0040.00416.42
7.4.210.0130.00916.72
7.4.200.0030.00316.36
7.4.160.0070.01016.56
7.4.150.0100.00717.40
7.4.140.0090.00917.86
7.4.130.0070.01116.50
7.4.120.0130.00616.56
7.4.110.0070.01116.48
7.4.100.0110.00816.57
7.4.90.0120.00616.51
7.4.80.0110.01019.39
7.4.70.0120.01216.53
7.4.60.0120.00316.46
7.4.50.0000.01516.66
7.4.40.0080.00816.58
7.4.00.0040.01415.12
7.3.330.0000.00813.40
7.3.320.0030.00313.21
7.3.310.0000.00816.40
7.3.300.0070.00016.43
7.3.290.0070.01116.39
7.3.280.0080.01216.40
7.3.270.0090.01017.40
7.3.260.0080.01316.49
7.3.240.0070.01016.49
7.3.230.0060.01216.44
7.3.210.0030.01316.31
7.3.200.0090.00616.43
7.3.190.0060.01216.60
7.3.180.0090.00816.52
7.3.170.0070.01116.57
7.3.160.0130.00316.57
7.3.120.0130.00714.87
7.3.110.0100.00714.42
7.3.100.0120.00414.90
7.3.90.0040.00814.92
7.3.80.0000.01514.74
7.3.70.0030.01014.78
7.3.60.0110.00314.75
7.3.50.0000.00914.79
7.3.40.0000.01114.87
7.3.30.0030.00514.86
7.3.20.0100.00716.63
7.3.10.0090.00316.60
7.3.00.0040.01116.79
7.2.330.0070.01016.65
7.2.320.0060.01016.50
7.2.310.0140.00316.79
7.2.300.0060.01216.66
7.2.290.0100.01316.68
7.2.250.0100.01014.67
7.2.240.0030.01515.00
7.2.230.0080.00814.79
7.2.220.0030.01314.91
7.2.210.0060.00315.10
7.2.200.0030.01014.97
7.2.190.0060.00314.98
7.2.180.0070.00715.02
7.2.170.0000.00915.04
7.2.160.0080.00515.07
7.2.150.0080.00816.93
7.2.140.0000.01416.62
7.2.130.0090.00616.74
7.2.120.0060.01216.91
7.2.110.0040.01416.87
7.2.100.0000.01316.84
7.2.90.0070.01016.90
7.2.80.0030.01316.58
7.2.70.0090.00616.87
7.2.60.0060.00716.83
7.2.50.0080.00416.80
7.2.40.0000.01416.97
7.2.30.0080.00416.81
7.2.20.0070.01118.38
7.2.10.0080.01018.30
7.2.00.0060.01418.46
7.1.330.0110.00715.74
7.1.320.0030.01015.67
7.1.310.0030.00915.75
7.1.300.0000.00915.30
7.1.290.0040.01115.69
7.1.280.0030.00615.88
7.1.270.0060.01015.65
7.1.260.0070.01015.69
7.1.250.0060.00915.42
7.1.240.0060.01015.77
7.1.230.0060.00615.62
7.1.220.0030.01015.31
7.1.210.0090.00315.50
7.1.200.0030.00815.52
7.1.190.0000.01515.51
7.1.180.0040.01215.75
7.1.170.0070.00715.58
7.1.160.0090.00615.59
7.1.150.0060.00615.67
7.1.140.0070.00917.04
7.1.130.0110.00417.05
7.1.120.0040.01417.13
7.1.110.0050.00716.91
7.1.100.0070.00816.70
7.1.90.0060.01116.69
7.1.80.0070.00816.99
7.1.70.0050.00916.23
7.1.60.0170.01025.22
7.1.50.0150.01625.11
7.1.40.0190.01324.89
7.1.30.0160.01725.11
7.1.20.0170.01525.07
7.1.10.0060.00915.94
7.1.00.0080.00716.13
7.0.330.0090.00615.18
7.0.320.0000.01015.23
7.0.310.0070.01015.11
7.0.300.0000.01415.47
7.0.290.0000.00815.19
7.0.280.0030.01015.38
7.0.270.0100.00715.28
7.0.260.0000.00815.22
7.0.250.0030.01015.27
7.0.240.0060.00815.29
7.0.230.0100.00315.45
7.0.220.0000.01415.09
7.0.210.0070.00315.36
7.0.200.0040.00715.38
7.0.190.0100.00714.91
7.0.180.0100.00715.39
7.0.170.0070.00715.38
7.0.160.0030.00615.48
7.0.150.0000.01315.35
7.0.140.0040.00815.12
7.0.130.0040.00815.48
7.0.120.0030.00515.11
7.0.110.0040.00715.21
7.0.100.0000.01315.41
7.0.90.0000.01415.46
7.0.80.0030.00615.30
7.0.70.0050.00515.17
7.0.60.0030.01015.43
7.0.50.0030.00915.12
7.0.40.0050.00513.11
7.0.30.0090.00613.48
7.0.20.0070.00413.23
7.0.10.0050.00313.53
7.0.00.0060.00613.42
5.6.400.0070.00714.38
5.6.390.0040.01114.45
5.6.380.0060.00914.09
5.6.370.0080.00414.21
5.6.360.0000.00913.74
5.6.350.0030.01014.26
5.6.340.0060.00914.34
5.6.330.0060.00314.11
5.6.320.0030.01114.35
5.6.310.0060.00313.93
5.6.300.0000.01514.10
5.6.290.0090.00614.14
5.6.280.0040.00414.23
5.6.270.0110.00414.29
5.6.260.0000.01314.39
5.6.250.0080.00314.24
5.6.240.0040.01214.16
5.6.230.0030.01014.32
5.6.220.0000.01013.91
5.6.210.0000.00914.07
5.6.200.0030.00614.19
5.6.190.0090.00614.22
5.6.180.0040.00914.57
5.6.170.0000.00814.25
5.6.160.0030.01314.09
5.6.150.0070.00713.91
5.6.140.0030.01014.13
5.6.130.0070.00314.45
5.6.120.0040.00714.28
5.6.110.0060.00314.26
5.6.100.0040.00914.45
5.6.90.0070.01014.16
5.6.80.0070.00413.94
5.6.70.0030.00714.21
5.6.60.0060.00914.07
5.6.50.0040.00814.21
5.6.40.0140.00313.94
5.6.30.0000.01814.32
5.6.20.0000.01114.14
5.6.10.0070.00714.02
5.6.00.0000.01314.17

preferences:
47.11 ms | 403 KiB | 5 Q