3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Cipher { private $securekey, $iv; function __construct($textkey) { $this->securekey = hash('sha256',$textkey,TRUE); $this->iv = mcrypt_create_iv(32); } function encrypt($input) { return base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $this->securekey, $input, MCRYPT_MODE_ECB, $this->iv)); } function decrypt($input) { return rtrim(trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $this->securekey, base64_decode($input), MCRYPT_MODE_ECB, $this->iv)),"\0"); } } $cipher = new Cipher('secret passphrase'); $encryptedtext = $cipher->encrypt("hide me"); echo "->encrypt = $encryptedtext<br />"; $decryptedtext = $cipher->decrypt($encryptedtext); echo "->decrypt = $decryptedtext<br />"; var_dump($decryptedtext);

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.01418.56
8.3.50.0130.01021.27
8.3.40.0090.00620.72
8.3.30.0110.00420.29
8.3.20.0070.00020.39
8.3.10.0000.00822.00
8.3.00.0050.00322.51
8.2.180.0140.01416.63
8.2.170.0040.01222.96
8.2.160.0070.01322.31
8.2.150.0000.00824.18
8.2.140.0080.00624.66
8.2.130.0040.00426.16
8.2.120.0040.00420.88
8.2.110.0060.00322.29
8.2.100.0030.01017.66
8.2.90.0000.00819.05
8.2.80.0040.00419.38
8.2.70.0070.00317.63
8.2.60.0000.00917.80
8.2.50.0080.00018.07
8.2.40.0000.00819.82
8.2.30.0040.00419.50
8.2.20.0000.00717.55
8.2.10.0000.00717.61
8.2.00.0050.00317.72
8.1.280.0110.00425.92
8.1.270.0070.00023.99
8.1.260.0070.00026.35
8.1.250.0030.00628.09
8.1.240.0050.00523.81
8.1.230.0080.00319.16
8.1.220.0040.00417.74
8.1.210.0000.00918.77
8.1.200.0030.00616.98
8.1.190.0030.00617.30
8.1.180.0000.00918.10
8.1.170.0030.00518.53
8.1.160.0000.00818.77
8.1.150.0030.00618.58
8.1.140.0000.00717.25
8.1.130.0000.00817.72
8.1.120.0030.00417.26
8.1.110.0020.00517.42
8.1.100.0000.00717.38
8.1.90.0050.00317.48
8.1.80.0040.00417.32
8.1.70.0030.00317.38
8.1.60.0070.00417.60
8.1.50.0000.00717.43
8.1.40.0040.00417.57
8.1.30.0000.00817.63
8.1.20.0080.00017.72
8.1.10.0000.00717.61
8.1.00.0050.00517.51
8.0.300.0050.00318.77
8.0.290.0040.00417.05
8.0.280.0030.00318.32
8.0.270.0030.00317.21
8.0.260.0030.00316.86
8.0.250.0070.00016.89
8.0.240.0000.00817.01
8.0.230.0070.00016.90
8.0.220.0070.00016.85
8.0.210.0000.00816.93
8.0.200.0040.00416.89
8.0.190.0040.00416.84
8.0.180.0040.00416.98
8.0.170.0050.00316.86
8.0.160.0040.00416.80
8.0.150.0030.00316.77
8.0.140.0050.00316.90
8.0.130.0030.00313.30
8.0.120.0080.00016.83
8.0.110.0030.00516.89
8.0.100.0040.00416.91
8.0.90.0000.00716.80
8.0.80.0030.01216.80
8.0.70.0080.00016.97
8.0.60.0060.00316.79
8.0.50.0000.00716.78
8.0.30.0110.00816.86
8.0.20.0120.01017.40
8.0.10.0040.00417.10
8.0.00.0120.00816.91
7.4.330.0000.00515.00
7.4.320.0000.00716.46
7.4.300.0040.00416.54
7.4.290.0030.00616.45
7.4.280.0070.00016.43
7.4.270.0040.00416.50
7.4.260.0000.00913.22
7.4.250.0000.00716.38
7.4.240.0020.00516.56
7.4.230.0070.00016.66
7.4.220.0160.00316.39
7.4.210.0080.00616.48
7.4.200.0030.00316.50
7.4.190.0040.00416.60
7.4.160.0160.00016.61
7.4.150.0070.01117.40
7.4.140.0110.01117.86
7.4.130.0040.01316.52
7.4.120.0110.00616.54
7.4.110.0120.00616.55
7.4.100.0100.00616.52
7.4.90.0110.00616.61
7.4.80.0100.01319.39
7.4.70.0120.00416.66
7.4.60.0140.00316.32
7.4.50.0050.00516.46
7.4.40.0030.00922.77
7.4.30.0030.01316.38
7.4.10.0070.01114.73
7.4.00.0110.00614.84
7.3.330.0000.00513.38
7.3.320.0000.00513.40
7.3.310.0000.00716.15
7.3.300.0000.00716.38
7.3.290.0070.01116.39
7.3.280.0070.01116.37
7.3.270.0100.00717.40
7.3.260.0130.00316.27
7.3.250.0180.00016.49
7.3.240.0100.01016.45
7.3.230.0030.01516.59
7.3.210.0050.01116.38
7.3.200.0120.00919.39
7.3.190.0150.00316.28
7.3.180.0110.00516.39
7.3.170.0040.01116.32
7.3.160.0140.00316.48
7.3.120.0030.01315.04
7.3.110.0100.00614.75
7.3.100.0090.00615.06
7.3.90.0070.01115.04
7.3.80.0100.00714.94
7.3.70.0030.00614.80
7.3.60.0130.00014.93
7.3.50.0060.01114.50
7.3.40.0030.00714.69
7.3.30.0000.01414.67
7.3.20.0070.00716.52
7.3.10.0070.00716.48
7.3.00.0020.01116.49
7.2.330.0070.01716.63
7.2.320.0110.00916.48
7.2.310.0030.01616.45
7.2.300.0040.01216.27
7.2.290.0090.00816.65
7.2.250.0110.00715.05
7.2.240.0140.00314.87
7.2.230.0030.01015.08
7.2.220.0040.01114.71
7.2.210.0000.01314.74
7.2.200.0060.00915.01
7.2.190.0090.00615.09
7.2.180.0100.00714.93
7.2.170.0090.00314.74
7.2.160.0030.00615.11
7.2.150.0070.00316.73
7.2.140.0060.00616.85
7.2.130.0050.00716.64
7.2.120.0050.00616.85
7.2.110.0110.00616.73
7.2.100.0060.00616.79
7.2.90.0070.00816.56
7.2.80.0080.00916.92
7.2.70.0090.00716.84
7.2.60.0030.01216.68
7.2.50.0110.00816.88
7.2.40.0020.01116.71
7.2.30.0100.00816.70
7.2.20.0110.00916.89
7.2.10.0060.01416.86
7.2.00.0070.00717.60
7.1.330.0100.00715.69
7.1.320.0000.01415.69
7.1.310.0060.01015.85
7.1.300.0100.00315.72
7.1.290.0040.00815.50
7.1.280.0060.00615.75
7.1.270.0000.00915.73
7.1.260.0110.00415.75
7.1.250.0090.00415.58
7.1.240.0030.00615.79
7.1.230.0070.01015.69
7.1.220.0060.01015.69
7.1.210.0070.00715.72
7.1.200.0060.00815.58
7.1.190.0040.00715.84
7.1.180.0120.00315.70
7.1.170.0120.00015.81
7.1.160.0080.00015.80
7.1.150.0070.01015.70
7.1.140.0090.00915.89
7.1.130.0070.00615.59
7.1.120.0110.00415.73
7.1.110.0120.00315.55
7.1.100.0090.00716.89
7.1.90.0030.01415.71
7.1.80.0040.00815.82
7.1.70.0060.00916.54
7.1.60.0050.01117.45
7.1.50.0050.01416.36
7.1.40.0030.01415.43
7.1.30.0060.00315.61
7.1.20.0000.01215.82
7.1.10.0100.00615.66
7.1.00.0010.02419.03
7.0.330.0030.01215.14
7.0.320.0080.00015.43
7.0.310.0030.01015.19
7.0.300.0080.00415.24
7.0.290.0060.00315.46
7.0.280.0030.00715.29
7.0.270.0000.01315.45
7.0.260.0110.00715.33
7.0.250.0090.00615.53
7.0.240.0070.01015.51
7.0.230.0030.00915.42
7.0.220.0030.01015.20
7.0.210.0060.00615.35
7.0.200.0020.00716.06
7.0.190.0030.00915.55
7.0.180.0030.01015.43
7.0.170.0110.00315.37
7.0.160.0030.01315.48
7.0.150.0060.00815.59
7.0.140.0090.03918.73
7.0.130.0030.00915.42
7.0.120.0030.01015.35
7.0.110.0070.00715.41
7.0.100.0080.04117.73
7.0.90.0050.04817.67
7.0.80.0020.04917.60
7.0.70.0050.02717.71
7.0.60.0100.03817.71
7.0.50.0300.03917.95
7.0.40.0080.04016.79
7.0.30.0070.04516.84
7.0.20.0080.04316.84
7.0.10.0070.03716.88
7.0.00.0090.04116.89
5.6.400.0000.01514.67
5.6.390.0100.00314.00
5.6.380.0000.01014.34
5.6.370.0050.00814.34
5.6.360.0100.00714.41
5.6.350.0090.00414.32
5.6.340.0040.01414.27
5.6.330.0070.00714.65
5.6.320.0060.00914.48
5.6.310.0000.01814.12
5.6.300.0070.01114.59
5.6.290.0000.01514.11
5.6.280.0070.00314.50
5.6.270.0090.00614.26
5.6.260.0030.01314.26
5.6.250.0090.04217.42
5.6.240.0070.04317.40
5.6.230.0020.04517.58
5.6.220.0050.04017.59
5.6.210.0130.03517.49
5.6.200.0100.03317.80
5.6.190.0030.04117.83
5.6.180.0100.04017.87
5.6.170.0080.04517.57
5.6.160.0030.04317.53
5.6.150.0080.04317.61
5.6.140.0120.04017.74
5.6.130.0050.04317.81
5.6.120.0100.02617.65
5.6.110.0060.04417.54
5.6.100.0130.04217.64
5.6.90.0030.05017.60
5.6.80.0060.04017.38
5.6.70.0050.04617.45
5.6.60.0100.03717.30
5.6.50.0060.04817.29
5.6.40.0070.04217.41
5.6.30.0080.04217.30
5.6.20.0050.04317.40
5.6.10.0070.03917.43
5.6.00.0050.02817.34
5.5.380.0150.03817.31
5.5.370.0050.04517.38
5.5.360.0100.03817.21
5.5.350.0070.02817.37
5.5.340.0090.02517.55
5.5.330.0100.04317.52
5.5.320.0040.05117.47
5.5.310.0090.04017.47
5.5.300.0070.04517.39
5.5.290.0140.02817.73
5.5.280.0050.03517.42
5.5.270.0070.03017.59
5.5.260.0140.03717.68
5.5.250.0020.04717.51
5.5.240.0050.02817.12
5.5.230.0100.03917.19
5.5.220.0040.02917.25
5.5.210.0030.04517.29
5.5.200.0090.04117.13
5.5.190.0020.03517.27
5.5.180.0050.04517.29
5.5.170.0090.00314.29
5.5.160.0070.03817.15
5.5.150.0050.04517.09
5.5.140.0110.02817.28
5.5.130.0050.04217.25
5.5.120.0130.03517.30
5.5.110.0080.04217.16
5.5.100.0090.02817.07
5.5.90.0050.04317.06
5.5.80.0080.02517.14
5.5.70.0080.04017.00
5.5.60.0080.02817.20
5.5.50.0080.04017.07
5.5.40.0050.03716.98
5.5.30.0040.04217.10
5.5.20.0050.04917.12
5.5.10.0030.04617.19
5.5.00.0090.03517.08
5.4.450.0080.03515.36
5.4.440.0130.04015.32
5.4.430.0150.03715.33
5.4.420.0090.04015.33
5.4.410.0060.03615.21
5.4.400.0050.04415.22
5.4.390.0030.02715.17
5.4.380.0080.03615.09
5.4.370.0100.03615.16
5.4.360.0050.04315.24
5.4.350.0050.03915.08
5.4.340.0100.03815.21
5.4.330.0030.00311.23
5.4.320.0040.04215.07
5.4.310.0030.04315.20
5.4.300.0020.02515.07
5.4.290.0060.04015.16
5.4.280.0080.03515.15
5.4.270.0070.04515.16
5.4.260.0060.04115.16
5.4.250.0030.03815.15
5.4.240.0050.02515.21
5.4.230.0020.04015.20
5.4.220.0090.03515.11
5.4.210.0030.04415.14
5.4.200.0040.04015.21
5.4.190.0110.02215.16
5.4.180.0080.03715.20
5.4.170.0050.03615.07
5.4.160.0050.04315.15
5.4.150.0090.03815.06
5.4.140.0100.03513.87
5.4.130.0030.02913.87
5.4.120.0050.03513.87
5.4.110.0050.04013.89
5.4.100.0050.03813.85
5.4.90.0050.02313.85
5.4.80.0060.03813.88
5.4.70.0040.04413.84
5.4.60.0050.02313.88
5.4.50.0020.04413.81
5.4.40.0050.03213.87
5.4.30.0070.04013.80
5.4.20.0090.03513.83
5.4.10.0030.04413.87
5.4.00.0020.04313.59
5.3.290.0050.03312.96
5.3.280.0050.02812.88
5.3.270.0050.03712.90
5.3.260.0080.03712.99
5.3.250.0090.02112.94
5.3.240.0070.03712.88
5.3.230.0020.02612.89
5.3.220.0020.02512.96
5.3.210.0050.04212.96
5.3.200.0030.02512.93
5.3.190.0110.03012.95
5.3.180.0030.04112.90
5.3.170.0100.03012.90
5.3.160.0050.04012.96
5.3.150.0050.03812.97
5.3.140.0080.02712.91
5.3.130.0070.03312.88
5.3.120.0050.05712.88
5.3.110.0070.03812.92
5.3.100.0050.03812.63
5.3.90.0030.04312.70
5.3.80.0050.04212.66
5.3.70.0020.03412.66
5.3.60.0000.04312.63
5.3.50.0070.02812.66
5.3.40.0050.03712.63
5.3.30.0050.03812.60
5.3.20.0080.03612.42
5.3.10.0080.03512.46
5.3.00.0090.02712.43
5.2.170.0030.06011.07
5.2.160.0030.06311.26
5.2.150.0100.05011.02
5.2.140.0000.04011.18
5.2.130.0100.06011.13
5.2.120.0030.04011.06
5.2.110.0030.06011.10
5.2.100.0100.05311.05
5.2.90.0130.02711.18
5.2.80.0130.04711.13
5.2.70.0100.03011.11
5.2.60.0030.03011.18
5.2.50.0000.03310.95
5.2.40.0030.03011.01
5.2.30.0000.03311.09
5.2.20.0000.06010.83
5.2.10.0030.02711.01
5.2.00.0030.02710.73
5.1.60.0100.01710.11
5.1.50.0000.02710.11
5.1.40.0000.02310.11
5.1.30.0000.02710.31
5.1.20.0000.02710.46
5.1.10.0000.02710.11
5.1.00.0000.02710.14
5.0.50.0000.02010.11
5.0.40.0000.02010.11
5.0.30.0000.03710.11
5.0.20.0000.02010.11
5.0.10.0030.02010.11
5.0.00.0000.03010.11
4.4.90.0000.01710.11
4.4.80.0030.03010.11
4.4.70.0000.02010.11
4.4.60.0030.01310.11
4.4.50.0030.01710.11
4.4.40.0000.02710.11
4.4.30.0000.01710.11
4.4.20.0000.01710.11
4.4.10.0000.01710.11
4.4.00.0030.02010.11
4.3.110.0070.01010.11
4.3.100.0030.01310.11
4.3.90.0000.02010.11
4.3.80.0000.04710.11
4.3.70.0000.01310.11
4.3.60.0030.02310.11
4.3.50.0000.03010.11
4.3.40.0030.04010.11
4.3.30.0000.02310.11
4.3.20.0030.01010.11
4.3.10.0000.01310.11
4.3.00.0000.03710.11

preferences:
43.33 ms | 401 KiB | 5 Q