import zend standard tests
[hiphop-php.git] / hphp / test / zend / bad / ext-standard-strings / md5_basic2.php
blobe920bc4719341e6ccee281b70dec71a1687ff57a
1 <?php
2 /* Prototype : string md5 ( string $str [, bool $raw_output= false ] )
3 * Description: Calculate the md5 hash of a string
4 * Source code: ext/standard/md5.c
5 */
7 echo "*** Testing md5() : basic functionality - with raw output***\n";
8 $str = b"Hello World";
9 $md5_raw = md5($str, true);
10 var_dump(bin2hex($md5_raw));
12 $md5 = md5($str, false);
14 if (strcmp(bin2hex($md5_raw), $md5) == 0 ) {
15 echo "TEST PASSED\n";
16 } else {
17 echo "TEST FAILED\n";
18 var_dump($md5_raw, $md5);
22 ===DONE===