3v4l.org

run code in 300+ PHP versions simultaneously
<?php $key = 'password to (en/de)crypt'; $string = ' {login:"admin", password:"12311231!"} '; // 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.0070.01416.25
8.3.50.0110.01116.50
8.3.40.0030.01718.93
8.3.30.0070.01118.67
8.3.20.0040.00420.11
8.3.10.0040.00423.61
8.3.00.0070.00021.90
8.2.180.0070.01016.88
8.2.170.0110.00322.96
8.2.160.0100.00720.39
8.2.150.0050.00324.18
8.2.140.0080.00024.66
8.2.130.0050.00321.04
8.2.120.0040.00426.35
8.2.110.0030.00621.05
8.2.100.0120.00017.93
8.2.90.0000.00819.09
8.2.80.0000.00817.97
8.2.70.0060.00317.38
8.2.60.0040.00417.80
8.2.50.0040.00418.09
8.2.40.0030.00622.17
8.2.30.0070.00019.34
8.2.20.0000.01017.63
8.2.10.0040.00417.98
8.2.00.0000.01018.13
8.1.280.0150.00425.92
8.1.270.0120.00322.11
8.1.260.0070.00028.09
8.1.250.0050.00228.09
8.1.240.0030.00622.42
8.1.230.0000.01019.15
8.1.220.0050.00317.74
8.1.210.0080.00018.77
8.1.200.0060.00317.23
8.1.190.0040.00417.34
8.1.180.0040.00418.10
8.1.170.0030.00518.52
8.1.160.0030.00520.76
8.1.150.0040.00420.57
8.1.140.0040.00419.45
8.1.130.0050.00517.56
8.1.120.0030.00317.41
8.1.110.0070.00317.34
8.1.100.0040.00417.32
8.1.90.0000.00717.48
8.1.80.0000.00717.43
8.1.70.0000.00717.35
8.1.60.0000.00817.60
8.1.50.0000.00817.55
8.1.40.0030.00617.59
8.1.30.0030.00617.57
8.1.20.0030.00617.55
8.1.10.0050.00217.59
8.1.00.0040.00417.55
8.0.300.0040.00418.77
8.0.290.0030.00616.75
8.0.280.0070.00018.39
8.0.270.0030.00317.24
8.0.260.0000.00617.25
8.0.250.0000.00716.89
8.0.240.0070.00016.96
8.0.230.0000.00716.93
8.0.220.0000.00716.81
8.0.210.0070.00016.88
8.0.200.0030.00316.86
8.0.190.0000.00817.02
8.0.180.0030.00316.89
8.0.170.0000.00816.95
8.0.160.0040.00417.01
8.0.150.0060.00316.80
8.0.140.0070.00016.89
8.0.130.0030.00313.29
8.0.120.0060.00316.86
8.0.110.0080.00016.82
8.0.100.0030.00516.81
8.0.90.0080.00016.86
8.0.80.0060.00816.93
8.0.70.0000.00816.77
8.0.60.0040.00416.85
8.0.50.0000.00716.78
8.0.30.0080.00817.05
8.0.20.0160.00717.40
8.0.10.0000.00717.10
8.0.00.0140.00916.71
7.4.330.0050.00016.79
7.4.320.0000.00616.38
7.4.300.0070.00016.60
7.4.290.0070.00016.57
7.4.280.0080.00016.50
7.4.270.0030.00416.61
7.4.260.0080.00016.43
7.4.250.0040.00416.58
7.4.240.0000.00716.59
7.4.230.0000.00716.42
7.4.220.0080.00816.71
7.4.210.0040.01116.56
7.4.200.0000.00716.52
7.4.160.0090.00616.46
7.4.150.0140.00417.40
7.4.140.0090.01417.86
7.4.130.0200.00316.71
7.4.120.0110.00816.49
7.4.110.0070.01116.59
7.4.100.0100.00716.55
7.4.90.0070.01716.72
7.4.80.0070.01019.39
7.4.70.0060.01616.55
7.4.60.0040.01416.49
7.4.50.0130.00316.46
7.4.40.0100.00716.42
7.4.30.0100.01016.57
7.4.00.0030.00614.91
7.3.330.0050.00013.18
7.3.320.0040.00313.26
7.3.310.0040.00416.21
7.3.300.0000.00616.19
7.3.290.0090.00916.25
7.3.280.0140.00616.27
7.3.270.0160.00617.40
7.3.260.0100.00716.43
7.3.240.0130.00916.34
7.3.230.0120.00616.45
7.3.210.0090.00616.52
7.3.200.0130.00419.39
7.3.190.0110.00616.19
7.3.180.0120.00916.26
7.3.170.0060.01116.45
7.3.160.0100.00716.47
7.2.330.0100.01316.32
7.2.320.0130.00716.27
7.2.310.0060.01216.44
7.2.300.0100.01016.57
7.2.290.0030.01316.47
7.2.60.0140.00716.31
7.2.00.0060.00919.02
7.1.200.0030.01015.71
7.1.100.0030.00918.13
7.1.70.0070.00316.90
7.1.60.0000.02119.40
7.1.50.0060.01316.87
7.1.00.0030.07722.40
7.0.200.0060.00316.70
7.0.60.0070.05021.66
7.0.50.0100.04017.97
7.0.40.0030.07320.21
7.0.30.0230.04720.18
7.0.20.0200.06020.21
7.0.10.0070.06020.00
7.0.00.0130.03720.09
5.6.280.0070.06320.83
5.6.210.0070.03720.72
5.6.200.0000.04318.18
5.6.190.0030.07020.40
5.6.180.0270.06020.36
5.6.170.0230.06720.52
5.6.160.0030.04320.34
5.6.150.0030.08718.23
5.6.140.0030.04318.20
5.6.130.0170.07718.16
5.6.120.0000.07021.03
5.6.110.0000.08721.21
5.6.100.0100.08321.15
5.6.90.0030.04021.01
5.6.80.0070.08320.43
5.5.350.4170.04020.31
5.5.340.0100.05317.93
5.5.330.0030.04720.21
5.5.320.0270.07320.30
5.5.310.0170.05720.18
5.5.300.0070.07018.02
5.5.290.0030.04017.93
5.5.280.0270.06320.92
5.5.270.0000.04720.71
5.5.260.0130.07320.84
5.5.250.0000.08320.66
5.5.240.0200.07720.30

preferences:
65.2 ms | 400 KiB | 5 Q