+++ /dev/null
---TEST--\r
-openssl_random_pseudo_bytes test\r
-https://bugs.php.net/bug.php?id=55169\r
---SKIPIF--\r
-<?php\r
-if(!extension_loaded('openssl')) echo 'skip - requires openssl extension';\r
-?>\r
---FILE--\r
-<?php\r
-for ($i = -1; $i <= 4; $i++) {\r
- $bytes = openssl_random_pseudo_bytes($i, $cstrong);\r
- $hex = bin2hex($bytes);\r
-\r
- echo "Lengths: Bytes: $i and Hex: " . strlen($hex) . PHP_EOL;\r
- var_dump($hex);\r
- var_dump($cstrong);\r
- echo PHP_EOL;\r
-}\r
-?>\r
---EXPECTF--\r
-Lengths: Bytes: -1 and Hex: 0\r
-string(0) ""\r
-NULL\r
-\r
-Lengths: Bytes: 0 and Hex: 0\r
-string(0) ""\r
-NULL\r
-\r
-Lengths: Bytes: 1 and Hex: 2\r
-string(2) "%x"\r
-bool(true)\r
-\r
-Lengths: Bytes: 2 and Hex: 4\r
-string(4) "%x"\r
-bool(true)\r
-\r
-Lengths: Bytes: 3 and Hex: 6\r
-string(6) "%x"\r
-bool(true)\r
-\r
-Lengths: Bytes: 4 and Hex: 8\r
-string(8) "%x"\r
-bool(true)\r