3v4l.org

run code in 300+ PHP versions simultaneously
<?php function base64url_encode($data) { return rtrim(strtr(base64_encode($data), '+/', '-_'), '='); } function base64url_decode($data) { return base64_decode(str_pad(strtr($data, '-_', '+/'), strlen($data) % 4, '=', STR_PAD_RIGHT)); } function encryptCode($data){ return mcrypt_encrypt( MCRYPT_DES , '12345678' , $data , 'cbc' ,'87654321'); } function decryptCode($data){ return mcrypt_decrypt( MCRYPT_DES , '12345678' , $data , 'cbc' ,'87654321'); } $id = 'Q2JmDpmqjNmGT4FJ2EkXXITOgc31ZA52'; $base64Decoded = base64url_decode($id); $decrypted = decryptCode($base64Decoded); print_r($decrypted."\n"); print_r("\n\n"); # Make the new plaintext string $toAdd = 'hellothere'; $additionalCipherText = encryptCode($toAdd); $additionalEncoded = base64url_encode($additionalCipherText); print_r("Additional cipher text:".$additionalEncoded."\n"); print_r("\n\n"); # Concatenate the plaintext and encrypt $plaintext = $decrypted.$toAdd; $cipherText = encryptCode($plaintext); $base64Encoded = base64url_encode($cipherText); print_r(" New cipher text: ".$base64Encoded."\n"); print_r("Original cipher text: ".$id.$additionalEncoded."\n"); # Try the reverse order $plaintext = $toAdd.$decrypted; $cipherText = encryptCode($plaintext); $base64Encoded = base64url_encode($cipherText); print_r(" New cipher text: ".$base64Encoded."\n"); print_r("Original cipher text: ".$additionalEncoded.$id."\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.3.130.0080.00018.29
8.3.120.0070.00320.71
8.3.110.0090.00618.50
8.3.100.0150.00616.79
8.3.90.0030.00526.77
8.3.80.0060.00317.97
8.3.70.0110.00716.75
8.3.60.0100.00716.63
8.3.50.0120.00921.97
8.3.40.0120.00418.76
8.3.30.0030.01218.64
8.3.20.0040.00421.76
8.3.10.0040.00422.00
8.3.00.0060.00619.68
8.2.250.0040.00418.63
8.2.240.0030.00517.38
8.2.230.0060.00320.94
8.2.220.0040.00424.06
8.2.210.0040.01126.77
8.2.200.0050.00516.47
8.2.190.0090.00616.75
8.2.180.0110.00718.54
8.2.170.0000.01522.96
8.2.160.0070.00720.57
8.2.150.0080.00024.18
8.2.140.0060.00324.66
8.2.130.0000.00818.09
8.2.120.0050.00326.35
8.2.110.0090.00021.02
8.2.100.0060.00617.91
8.2.90.0000.00817.84
8.2.80.0070.00018.16
8.2.70.0000.00818.04
8.2.60.0070.00317.93
8.2.50.0050.00318.10
8.2.40.0000.00819.33
8.2.30.0000.00719.40
8.2.20.0000.00818.16
8.2.10.0040.00418.14
8.2.00.0000.00817.90
8.1.300.0050.00516.77
8.1.290.0090.00030.84
8.1.280.0110.00325.92
8.1.270.0080.00023.95
8.1.260.0080.00026.35
8.1.250.0050.00228.09
8.1.240.0090.00022.59
8.1.230.0090.00320.91
8.1.220.0000.00817.77
8.1.210.0060.00318.85
8.1.200.0000.00917.35
8.1.190.0050.00317.13
8.1.180.0070.00018.10
8.1.170.0080.00018.59
8.1.160.0040.00418.77
8.1.150.0040.00418.80
8.1.140.0020.00519.51
8.1.130.0040.00417.43
8.1.120.0000.00717.37
8.1.110.0040.00417.43
8.1.100.0030.00517.38
8.1.90.0070.00017.45
8.1.80.0000.00717.44
8.1.70.0000.00817.34
8.1.60.0030.00517.65
8.1.50.0000.00917.57
8.1.40.0080.00017.55
8.1.30.0000.00817.59
8.1.20.0000.00817.70
8.1.10.0000.00717.63
8.1.00.0040.00417.41
8.0.300.0050.00320.03
8.0.290.0050.00316.88
8.0.280.0000.00718.54
8.0.270.0050.00317.17
8.0.260.0070.00016.93
8.0.250.0030.00316.96
8.0.240.0040.00416.96
8.0.230.0000.00817.04
8.0.220.0000.00717.00
8.0.210.0000.00817.05
8.0.200.0050.00216.97
8.0.190.0040.00417.00
8.0.180.0000.00716.97
8.0.170.0050.00216.91
8.0.160.0000.00716.95
8.0.150.0000.00716.92
8.0.140.0030.00316.96
8.0.130.0000.00513.42
8.0.120.0080.00016.98
8.0.110.0070.00016.79
8.0.100.0030.00616.79
8.0.90.0000.00716.89
8.0.80.0090.00817.00
8.0.70.0030.00616.85
8.0.60.0040.00416.86
8.0.50.0040.00416.89
8.0.30.0080.01317.19
8.0.20.0130.00617.40
8.0.10.0080.00017.01
8.0.00.0090.00917.02
7.4.330.0030.00315.55
7.4.320.0000.00716.47
7.4.300.0030.00316.66
7.4.290.0000.00716.68
7.4.280.0040.00416.49
7.4.270.0030.00316.46
7.4.260.0060.00316.51
7.4.250.0030.00316.59
7.4.240.0030.00316.65
7.4.230.0060.00316.73
7.4.220.0100.01016.73
7.4.210.0030.01316.55
7.4.200.0000.00716.58
7.4.160.0090.01116.67
7.4.150.0030.01417.40
7.4.140.0070.01017.86
7.4.130.0070.00916.58
7.4.120.0110.00616.53
7.4.110.0030.01416.40
7.4.100.0100.01316.49
7.4.90.0110.00616.59
7.4.80.0140.00319.39
7.4.70.0130.00316.63
7.4.60.0090.00916.60
7.4.50.0070.00716.52
7.4.40.0030.01416.59
7.4.30.0100.00716.76
7.4.00.0100.00615.20
7.3.330.0050.00013.17
7.3.320.0000.00613.25
7.3.310.0070.00016.39
7.3.300.0030.00316.23
7.3.290.0030.00316.30
7.3.280.0090.00916.40
7.3.270.0030.01417.40
7.3.260.0130.00516.43
7.3.250.0100.00816.43
7.3.240.0100.00816.56
7.3.230.0070.01816.39
7.3.210.0070.01016.29
7.3.200.0080.01216.69
7.3.190.0120.00916.47
7.3.180.0100.00716.51
7.3.170.0100.00616.42
7.3.160.0100.00516.56
7.2.330.0030.01516.54
7.2.320.0060.01016.43
7.2.310.0070.01016.63
7.2.300.0210.00016.66
7.2.290.0130.01016.75
7.2.60.0100.00716.63
7.2.50.0060.00616.98
7.2.00.0070.01319.00
7.1.200.0030.00715.39
7.1.70.0040.00417.26
7.1.60.0030.00717.13
7.1.50.0000.01616.96
7.1.10.0400.05320.36
7.1.00.0330.05720.49
7.0.200.0100.00016.94
7.0.150.0370.05320.04
7.0.140.0830.05320.12
7.0.130.0300.06020.08
7.0.120.0300.05720.18
7.0.110.0400.07320.07
7.0.100.0470.06320.04
7.0.90.0430.05319.97
7.0.80.0230.06320.00
7.0.70.0100.06020.02
7.0.60.0330.06719.95
7.0.50.0530.05020.11
7.0.40.0330.05020.11
7.0.30.0370.05321.87
7.0.20.0330.05020.05
7.0.10.0430.05020.09
7.0.00.0270.06020.09

preferences:
67.13 ms | 403 KiB | 5 Q