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");
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function mcrypt_encrypt() in /in/7amfr:10 Stack trace: #0 {main} thrown in /in/7amfr on line 10
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
29.51 ms | 405 KiB | 5 Q