3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* 128-bit key = 01 23 45 67 12 34 56 78 23 45 67 89 34 56 78 9A plaintext = 01 23 45 67 89 AB CD EF ciphertext = 23 8B 4F E5 84 7E 44 B2 */ $key = "\x01\x23\x45\x67\x12\x34\x56\x78\x23\x45\x67\x89\x34\x56\x78\x9A"; $data = "\x01\x23\x45\x67\x89\xAB\xCD\xEF"; var_dump(mcrypt_encrypt('cast-128', $key, $data, 'ecb') === "\x23\x8B\x4F\xE5\x84\x7E\x44\xB2"); /* 80-bit key = 01 23 45 67 12 34 56 78 23 45 = 01 23 45 67 12 34 56 78 23 45 00 00 00 00 00 00 plaintext = 01 23 45 67 89 AB CD EF ciphertext = EB 6A 71 1A 2C 02 27 1B */ $key = "\x01\x23\x45\x67\x12\x34\x56\x78\x23\x45"; $data = "\x01\x23\x45\x67\x89\xAB\xCD\xEF"; $key .= "\x00\x00\x00\x00\x00\x00"; var_dump(mcrypt_encrypt('cast-128', $key, $data, 'ecb') === "\xEB\x6A\x71\x1A\x2C\x02\x27\x1B"); /* 40-bit key = 01 23 45 67 12 = 01 23 45 67 12 00 00 00 00 00 00 00 00 00 00 00 plaintext = 01 23 45 67 89 AB CD EF ciphertext = 7A C8 16 D1 6E 9B 30 2E */ $key = "\x01\x23\x45\x67\x12"; $data = "\x01\x23\x45\x67\x89\xAB\xCD\xEF"; $key .= "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"; var_dump(mcrypt_encrypt('cast-128', $key, $data, 'ecb') === "\x7A\xC8\x16\xD1\x6E\x9B\x30\x2E");

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.0080.00817.77
8.4.10.0090.00019.70
8.3.140.0070.01116.71
8.3.130.0040.00418.30
8.3.120.0130.00620.58
8.3.110.0080.00016.91
8.3.100.0100.01016.75
8.3.90.0080.00026.77
8.3.80.0090.00018.68
8.3.70.0150.00416.63
8.3.60.0140.00718.56
8.3.50.0110.00821.08
8.3.40.0150.00018.61
8.3.30.0100.00318.94
8.3.20.0080.00020.33
8.3.10.0040.00421.92
8.3.00.0070.00022.57
8.2.260.0030.00517.18
8.2.250.0050.00318.73
8.2.240.0000.00817.22
8.2.230.0060.00320.94
8.2.220.0060.00337.54
8.2.210.0000.00726.77
8.2.200.0000.00818.54
8.2.190.0060.01016.63
8.2.180.0060.01518.54
8.2.170.0100.01018.95
8.2.160.0070.00722.96
8.2.150.0000.00724.18
8.2.140.0040.00424.66
8.2.130.0000.00826.16
8.2.120.0050.00319.64
8.2.110.0090.00320.53
8.2.100.0070.00719.38
8.2.90.0050.00319.17
8.2.80.0000.00719.46
8.2.70.0030.00617.63
8.2.60.0030.00617.80
8.2.50.0060.00318.07
8.2.40.0080.00018.16
8.2.30.0030.00518.09
8.2.20.0070.00017.69
8.2.10.0030.00517.84
8.2.00.0030.00517.70
8.1.310.0110.00716.91
8.1.300.0050.00316.55
8.1.290.0040.00418.88
8.1.280.0090.00925.92
8.1.270.0050.00322.09
8.1.260.0000.00726.35
8.1.250.0080.00028.09
8.1.240.0100.00023.66
8.1.230.0110.00019.16
8.1.220.0050.00317.79
8.1.210.0000.00918.77
8.1.200.0060.00317.22
8.1.190.0080.00017.51
8.1.180.0030.00618.83
8.1.170.0030.00518.49
8.1.160.0040.00422.08
8.1.150.0080.00018.55
8.1.140.0040.00417.43
8.1.130.0030.00317.86
8.1.120.0030.00417.32
8.1.110.0020.00517.43
8.1.100.0030.00417.32
8.1.90.0050.00517.46
8.1.80.0000.00717.43
8.1.70.0000.00717.44
8.1.60.0030.00617.54
8.1.50.0000.00817.52
8.1.40.0040.00417.56
8.1.30.0040.00417.64
8.1.20.0000.00817.59
8.1.10.0070.00017.63
8.1.00.0080.00017.43
8.0.300.0040.00418.77
8.0.290.0080.00017.16
8.0.280.0050.00318.33
8.0.270.0030.00317.24
8.0.260.0080.00016.77
8.0.250.0000.00717.06
8.0.240.0080.00017.02
8.0.230.0070.00016.95
8.0.220.0030.00316.82
8.0.210.0000.00716.93
8.0.200.0030.00616.99
8.0.190.0100.00317.01
8.0.180.0000.00716.88
8.0.170.0040.00416.96
8.0.160.0000.00816.90
8.0.150.0000.00716.85
8.0.140.0000.00716.94
8.0.130.0000.00513.35
8.0.120.0070.00016.91
8.0.110.0000.00716.93
8.0.100.0000.00716.93
8.0.90.0050.00216.84
8.0.80.0150.00016.99
8.0.70.0040.00416.78
8.0.60.0000.00716.83
8.0.50.0030.00616.78
8.0.30.0090.00917.17
8.0.20.0100.00917.40
8.0.10.0060.00317.02
8.0.00.0100.01216.58
7.4.330.0020.00215.00
7.4.320.0030.00316.51
7.4.300.0000.00616.67
7.4.290.0000.00716.50
7.4.280.0030.00516.59
7.4.270.0030.00316.53
7.4.260.0000.00616.54
7.4.250.0030.00516.43
7.4.240.0020.00616.44
7.4.230.0000.00716.55
7.4.220.0060.01116.61
7.4.210.0060.00716.59
7.4.200.0000.00716.38
7.4.190.0070.00016.49
7.4.150.0040.01217.40
7.4.140.0110.00717.86
7.4.130.0070.01416.50
7.4.120.0090.00816.47
7.4.110.0150.00616.64
7.4.100.0040.01416.55
7.4.90.0130.00316.74
7.4.80.0030.01619.39
7.4.70.0060.01216.42
7.4.60.0130.01016.68
7.4.50.0030.00616.36
7.4.40.0040.01522.77
7.4.30.0070.01416.52
7.4.00.0110.00614.83
7.3.330.0050.00013.14
7.3.320.0050.00013.23
7.3.310.0000.00716.34
7.3.300.0040.00316.28
7.3.290.0070.01016.29
7.3.280.0140.00216.28
7.3.270.0100.01317.40
7.3.260.0070.01016.23
7.3.250.0130.00616.38
7.3.240.0000.01716.39
7.3.230.0100.00716.39
7.3.210.0090.00616.39
7.3.200.0060.00919.39
7.3.190.0060.01016.53
7.3.180.0130.00416.43
7.3.170.0060.01516.45
7.3.160.0120.00316.39
7.3.120.0090.00614.73
7.3.110.0090.00914.74
7.3.100.0080.00414.64
7.3.90.0040.00414.84
7.3.80.0030.01014.98
7.3.70.0030.00914.74
7.3.60.0030.00914.63
7.3.50.0030.00914.59
7.3.40.0060.00914.79
7.3.30.0030.01014.84
7.3.20.0030.01016.59
7.3.10.0050.00816.40
7.3.00.0060.00916.58
7.2.330.0090.00916.50
7.2.320.0060.01116.29
7.2.310.0120.00616.30
7.2.300.0120.00616.60
7.2.290.0000.01616.46
7.2.250.0060.01214.99
7.2.240.0030.01314.83
7.2.230.0000.01414.94
7.2.220.0000.00915.11
7.2.210.0050.00514.78
7.2.200.0080.00614.83
7.2.190.0060.00315.03
7.2.180.0080.00814.82
7.2.170.0030.01014.71
7.2.130.0000.01316.70
7.2.120.0070.00716.87
7.2.110.0100.00516.71
7.2.100.0080.00716.74
7.2.90.0090.00816.63
7.2.80.0070.00716.56
7.2.70.0080.00716.72
7.2.60.0060.00716.63
7.2.50.0090.00616.84
7.2.40.0080.00616.74
7.2.30.0070.00716.74
7.2.20.0140.00316.80
7.2.10.0090.00316.60
7.2.00.0050.00917.56
7.1.330.0030.01015.52
7.1.320.0070.00715.73
7.1.310.0030.01015.83
7.1.300.0070.00315.78
7.1.290.0040.01115.64
7.1.280.0100.00315.66
7.1.270.0060.00615.64
7.1.260.0060.00615.47
7.1.250.0100.00015.70
7.1.230.0120.00415.59
7.1.220.0130.00315.32
7.1.210.0040.00815.56
7.1.200.0040.00915.60
7.1.190.0060.00615.63
7.1.180.0100.00315.36
7.1.170.0040.00915.72
7.1.160.0060.00915.59
7.1.150.0070.00715.30
7.1.140.0130.00015.70
7.1.130.0070.00715.72
7.1.120.0130.00315.66
7.1.110.0040.01115.63
7.1.100.0080.00616.69
7.1.90.0090.00315.48
7.1.80.0090.00615.77
7.1.70.0010.01016.24
7.1.60.0110.00817.76
7.1.50.0070.01416.27
7.1.40.0130.00515.89
7.1.30.0090.00615.80
7.1.20.0090.00915.61
7.1.10.0120.00015.57
7.1.00.0030.04418.93
7.0.310.0030.01015.27
7.0.300.0120.00415.35
7.0.290.0130.00315.34
7.0.280.0080.00515.11
7.0.270.0080.00815.18
7.0.260.0060.00915.24
7.0.250.0000.01715.13
7.0.240.0070.00715.46
7.0.230.0100.00515.01
7.0.220.0110.00715.44
7.0.210.0080.00515.36
7.0.200.0090.00215.98
7.0.190.0080.00514.93
7.0.180.0090.00615.34
7.0.170.0130.00015.17
7.0.160.0100.00315.32
7.0.150.0060.00915.32
7.0.140.0070.03818.61
7.0.130.0100.00615.12
7.0.120.0120.00615.40
7.0.110.0090.00515.05
7.0.100.0070.00415.36
7.0.90.0080.00815.36
7.0.80.0050.00615.40
7.0.70.2580.02317.58
7.0.60.0050.02217.73
7.0.50.0050.02216.72
7.0.40.0070.03216.68
7.0.30.0090.04416.86
7.0.20.0140.02316.81
7.0.10.0080.03416.89
7.0.00.0110.04516.77
5.6.380.0100.00514.29
5.6.370.0090.00614.02
5.6.360.0050.00814.50
5.6.350.0000.01414.18
5.6.340.0120.00613.88
5.6.330.0070.00413.93
5.6.320.0130.00014.16
5.6.310.0070.00713.83
5.6.300.0080.00813.76
5.6.290.0070.00714.54
5.6.280.0100.03717.66
5.6.270.0080.00814.10
5.6.260.0130.00314.13
5.6.250.0080.01213.95
5.6.240.0030.00913.99
5.6.230.0100.00313.86
5.6.220.0090.00614.40
5.6.210.0100.02017.43
5.6.200.0050.04716.13
5.6.190.0100.03617.27
5.6.180.0150.02217.19
5.6.170.0230.02917.17
5.6.160.0020.02817.33
5.6.150.0080.04316.20
5.6.140.0060.03816.27
5.6.130.0070.03016.19
5.6.120.0090.04617.54
5.6.110.0090.03717.40
5.6.100.0050.04717.54
5.6.90.0090.04217.68
5.6.80.0130.03817.11
5.6.70.0190.03917.40
5.6.60.0060.00914.02
5.6.50.0120.00413.81
5.6.40.0100.00514.20
5.6.30.0120.00313.98
5.6.20.0130.00413.95
5.6.10.0070.01014.00
5.6.00.0040.01114.15
5.5.380.0030.00710.85
5.5.370.0060.00910.89
5.5.360.0080.00310.66
5.5.350.0050.04515.63
5.5.340.0070.04114.53
5.5.330.0060.03015.54
5.5.320.0090.02315.66
5.5.310.0150.02415.63
5.5.300.0050.02614.41
5.5.290.0070.03014.41
5.5.280.0060.03015.85
5.5.270.0060.02515.96
5.5.260.0070.03815.96
5.5.250.0090.03915.75
5.5.240.0150.03015.38
5.5.230.0080.00310.84
5.5.220.0030.00610.91
5.5.210.0070.00410.95
5.5.200.0100.00310.86
5.5.190.0000.00910.65
5.5.180.0040.00710.45
5.5.170.0100.00513.99
5.5.160.0070.00310.83
5.5.150.0040.00810.70
5.5.140.0080.00310.74
5.5.130.0080.00510.95
5.5.120.0060.00310.78
5.5.110.0100.00010.86
5.5.100.0000.01111.06
5.5.90.0130.00010.91
5.5.80.0080.00810.70
5.5.70.0100.00310.80
5.5.60.0040.00410.79
5.5.50.0090.00310.83
5.5.40.0070.00310.82
5.5.30.0100.00010.80
5.5.20.0050.00810.90
5.5.10.0090.00310.83
5.5.00.0050.00810.82
5.4.450.0410.03315.11
5.4.440.0430.03514.95
5.4.430.0380.03215.15
5.4.420.0540.03315.18
5.4.410.0370.03715.13
5.4.400.0490.03215.09
5.4.390.0470.02615.04
5.4.380.0140.03214.80
5.4.370.0410.02914.54
5.4.360.0160.02514.65
5.4.350.0200.09411.42
5.4.340.0060.03811.48
5.4.330.0040.00710.96
5.4.320.0060.02111.63
5.4.310.0050.02211.62
5.4.300.0080.01811.61
5.4.290.0070.02311.63
5.4.280.0040.02211.59
5.4.270.0080.01911.43
5.4.260.0060.02511.57
5.4.250.0100.02914.89
5.4.240.0050.02814.67
5.4.230.0020.03114.84
5.4.220.0100.02514.69
5.4.210.0060.02914.60
5.4.200.0040.03514.96
5.4.190.0040.03114.79
5.4.180.0090.02814.79
5.4.170.0080.02714.83
5.4.160.0110.02714.74
5.4.150.0070.03014.83
5.4.140.0060.02813.67
5.4.130.0080.02513.68
5.4.120.0090.02513.56
5.4.110.0050.03013.51
5.4.100.0050.03013.68
5.4.90.0060.02513.55
5.4.80.0070.02813.66
5.4.70.0080.02513.69
5.4.60.0110.02313.52
5.4.50.0070.02713.52
5.4.40.0070.02513.68
5.4.30.0030.03113.62
5.4.20.0080.02513.42
5.4.10.0080.02813.67
5.4.00.0110.02313.32
5.3.290.0050.02411.55
5.3.280.0070.03812.34
5.3.270.0040.03112.45
5.3.260.0110.02512.42
5.3.250.0130.03312.43
5.3.240.0020.03212.43
5.3.230.0090.02412.38
5.3.220.0050.03312.41
5.3.210.0080.03012.45
5.3.200.0120.02212.35
5.3.190.0100.02412.50
5.3.180.0100.02412.38
5.3.170.0050.03012.37
5.3.160.0110.02112.46
5.3.150.0070.03012.40
5.3.140.0080.02512.45
5.3.130.0110.03312.40
5.3.120.0070.02912.45
5.3.110.0030.03112.44
5.3.100.0080.02512.15
5.3.90.0020.02912.26
5.3.80.0100.03012.01
5.3.70.0070.02712.08
5.3.60.0040.02912.04
5.3.50.0020.03112.00
5.3.40.0100.02312.12
5.3.30.0060.03011.90
5.3.20.0070.02511.97
5.3.10.0050.02711.87
5.3.00.0050.02911.74
5.2.170.0040.02610.19
5.2.160.0100.01810.17
5.2.150.0060.02410.28
5.2.140.0060.02310.35
5.2.130.0030.02210.17
5.2.120.0100.01810.23
5.2.110.0040.02510.12
5.2.100.0080.01810.20
5.2.90.0030.02310.06
5.2.80.0040.02510.18
5.2.70.0040.02410.02
5.2.60.0080.02210.12
5.2.50.0070.0199.95
5.2.40.0060.02210.14
5.2.30.0040.02310.03
5.2.20.0050.01910.10
5.2.10.0080.0209.86
5.2.00.0020.0269.83
5.1.60.0050.0179.10
5.1.50.0070.0179.07
5.1.40.0080.0159.08
5.1.30.0050.0189.48
5.1.20.0060.0199.37
5.1.10.0050.0189.31
5.1.00.0050.0189.31
5.0.50.0050.0158.30
5.0.40.0020.0188.13
5.0.30.0020.0248.03
5.0.20.0030.0168.02
5.0.10.0070.0128.15
5.0.00.0050.0228.13
4.4.90.0020.0177.57
4.4.80.0000.0157.57
4.4.70.0020.0177.57
4.4.60.0040.0107.57
4.4.50.0030.0137.57
4.4.40.0020.0207.57
4.4.30.0040.0127.57
4.4.20.0050.0107.57
4.4.10.0020.0147.57
4.4.00.0020.0207.57
4.3.110.0050.0107.57
4.3.100.0020.0137.57
4.3.90.0050.0107.57
4.3.80.0070.0137.57
4.3.70.0050.0087.57
4.3.60.0000.0147.57
4.3.50.0060.0147.57
4.3.40.0030.0177.57
4.3.30.0020.0127.57
4.3.20.0060.0087.57
4.3.10.0020.0147.57
4.3.00.0080.0127.72

preferences:
89.59 ms | 406 KiB | 6 Q