1--TEST-- 2mcrypt_create_iv https://bugs.php.net/bug.php?id=55169 3--CREDIT-- 4Ryan Biesemeyer <ryan@yaauie.com> 5--SKIPIF-- 6<?php if (!extension_loaded("mcrypt")) print "skip"; ?> 7--FILE-- 8<?php 9for( $i=1; $i<=64; $i = $i*2 ){ 10 echo 'Input: '. $i . PHP_EOL; 11 $random = mcrypt_create_iv( $i, MCRYPT_DEV_URANDOM ); 12 echo ' Length: ' . strlen( $random ) . PHP_EOL; 13 echo ' Hex: '. bin2hex( $random ) . PHP_EOL; 14 echo PHP_EOL; 15} 16?> 17--EXPECTF-- 18Input: 1 19 20Deprecated: Function mcrypt_create_iv() is deprecated in %s%ebug55169.php on line 4 21 Length: 1 22 Hex: %x 23 24Input: 2 25 26Deprecated: Function mcrypt_create_iv() is deprecated in %s%ebug55169.php on line 4 27 Length: 2 28 Hex: %x 29 30Input: 4 31 32Deprecated: Function mcrypt_create_iv() is deprecated in %s%ebug55169.php on line 4 33 Length: 4 34 Hex: %x 35 36Input: 8 37 38Deprecated: Function mcrypt_create_iv() is deprecated in %s%ebug55169.php on line 4 39 Length: 8 40 Hex: %x 41 42Input: 16 43 44Deprecated: Function mcrypt_create_iv() is deprecated in %s%ebug55169.php on line 4 45 Length: 16 46 Hex: %x 47 48Input: 32 49 50Deprecated: Function mcrypt_create_iv() is deprecated in %s%ebug55169.php on line 4 51 Length: 32 52 Hex: %x 53 54Input: 64 55 56Deprecated: Function mcrypt_create_iv() is deprecated in %s%ebug55169.php on line 4 57 Length: 64 58 Hex: %x 59