mirror of
https://github.com/php/php-src.git
synced 2026-03-27 17:52:16 +01:00
fix tests
This commit is contained in:
@@ -6,13 +6,13 @@ function test($str) {
|
||||
$res = md5(base64_decode(base64_encode($str)))."\n";
|
||||
return $res;
|
||||
}
|
||||
echo test("");
|
||||
echo test("a");
|
||||
echo test("abc");
|
||||
echo test("message digest");
|
||||
echo test("abcdefghijklmnopqrstuvwxyz");
|
||||
echo test("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
|
||||
echo test("12345678901234567890123456789012345678901234567890123456789012345678901234567890");
|
||||
echo test(b"");
|
||||
echo test(b"a");
|
||||
echo test(b"abc");
|
||||
echo test(b"message digest");
|
||||
echo test(b"abcdefghijklmnopqrstuvwxyz");
|
||||
echo test(b"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789");
|
||||
echo test(b"12345678901234567890123456789012345678901234567890123456789012345678901234567890");
|
||||
?>
|
||||
--EXPECT--
|
||||
d41d8cd98f00b204e9800998ecf8427e
|
||||
|
||||
@@ -46,11 +46,11 @@ object(stdClass)#%d (0) {
|
||||
bool(false)
|
||||
bool(true)
|
||||
int(823)
|
||||
unicode(0) ""
|
||||
unicode(3) "foo"
|
||||
string(0) ""
|
||||
string(3) "foo"
|
||||
array(1) {
|
||||
[0]=>
|
||||
unicode(2) "12"
|
||||
string(2) "12"
|
||||
}
|
||||
array(2) {
|
||||
[0]=>
|
||||
@@ -62,11 +62,11 @@ array(2) {
|
||||
}
|
||||
array(3) {
|
||||
[0]=>
|
||||
unicode(3) "foo"
|
||||
string(3) "foo"
|
||||
[1]=>
|
||||
unicode(3) "bar"
|
||||
string(3) "bar"
|
||||
[2]=>
|
||||
unicode(3) "baz"
|
||||
string(3) "baz"
|
||||
}
|
||||
object(stdClass)#%d (0) {
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
Bug #24208 (base64_decode() not skipping 0xF0 - 0xFF)
|
||||
--FILE--
|
||||
<?php
|
||||
$data = str_repeat("a", 100);
|
||||
$data = str_repeat(b"a", 100);
|
||||
for ($i = 0xF0; $i < 0xFF + 1; $i++) {
|
||||
$enc = chunk_split(base64_encode($data), 10, chr($i));
|
||||
var_dump(base64_decode($enc));
|
||||
|
||||
@@ -9,7 +9,7 @@ Bug #36306 crc32() 64bit
|
||||
Have to find some small strings to truely reproduce
|
||||
the problem, this example being not a problem
|
||||
*/
|
||||
echo dechex(crc32("platform independant")) . "\n";
|
||||
echo dechex(crc32(b"platform independant")) . "\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
ccd9fe66
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
crc32() function
|
||||
--FILE--
|
||||
<?php
|
||||
$input = array("foo", "bar", "baz", "grldsajkopallkjasd");
|
||||
$input = array(b"foo", b"bar", b"baz", b"grldsajkopallkjasd");
|
||||
foreach($input AS $i) {
|
||||
printf("%u\n", crc32($i));
|
||||
}
|
||||
|
||||
@@ -9,15 +9,15 @@ if (!function_exists('crypt')) {
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$str = 'rasmuslerdorf';
|
||||
$salt1 = 'rl';
|
||||
$res_1 = 'rl.3StKT.4T8M';
|
||||
$salt2 = '_J9..rasm';
|
||||
$res_2 = '_J9..rasmBYk8r9AiWNc';
|
||||
$salt3 = '$1$rasmusle$';
|
||||
$res_3 = '$1$rasmusle$rISCgZzpwk3UhDidwXvin0';
|
||||
$salt4 = '$2a$07$rasmuslerd............';
|
||||
$res_4 = '$2a$07$rasmuslerd............nIdrcHdxcUxWomQX9j6kvERCFjTg7Ra';
|
||||
$str = b'rasmuslerdorf';
|
||||
$salt1 = b'rl';
|
||||
$res_1 = b'rl.3StKT.4T8M';
|
||||
$salt2 = b'_J9..rasm';
|
||||
$res_2 = b'_J9..rasmBYk8r9AiWNc';
|
||||
$salt3 = b'$1$rasmusle$';
|
||||
$res_3 = b'$1$rasmusle$rISCgZzpwk3UhDidwXvin0';
|
||||
$salt4 = b'$2a$07$rasmuslerd............';
|
||||
$res_4 = b'$2a$07$rasmuslerd............nIdrcHdxcUxWomQX9j6kvERCFjTg7Ra';
|
||||
|
||||
echo (CRYPT_STD_DES) ? ((crypt($str, $salt1) === $res_1) ? 'STD' : 'STD - ERROR') : 'STD', "\n";
|
||||
echo (CRYPT_EXT_DES) ? ((crypt($str, $salt2) === $res_2) ? 'EXT' : 'EXT - ERROR') : 'EXT', "\n";
|
||||
|
||||
@@ -19,3 +19,9 @@ echo html_entity_decode($ent_encoded);
|
||||
<>"&åÄ
|
||||
<>"&åÄ
|
||||
<>"&åÄ
|
||||
--UEXPECTF--
|
||||
Strict Standards: setlocale(): deprecated in Unicode mode, please use ICU locale functions in %s on line %d
|
||||
<>"&åÄ
|
||||
<>"&åÄ
|
||||
<>"&åÄ
|
||||
<>"&åÄ
|
||||
|
||||
@@ -9,7 +9,7 @@ strrev() function
|
||||
$str .= chr($i++);
|
||||
}
|
||||
|
||||
var_dump(md5(strrev($str)));
|
||||
var_dump(md5((binary)strrev($str)));
|
||||
var_dump(strrev(NULL));
|
||||
var_dump(strrev(""));
|
||||
?>
|
||||
|
||||
@@ -29,7 +29,8 @@ foreach( $strings as $string )
|
||||
Året
|
||||
Året ßen
|
||||
Året ßen
|
||||
--UEXPECT--
|
||||
--UEXPECTF--
|
||||
Strict Standards: setlocale(): deprecated in Unicode mode, please use ICU locale functions in %s on line %d
|
||||
SSen
|
||||
Ssen
|
||||
Året
|
||||
|
||||
@@ -21,3 +21,6 @@ echo strtoupper($chars)."\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
ÄÖÜ
|
||||
--UEXPECTF--
|
||||
Strict Standards: setlocale(): deprecated in Unicode mode, please use ICU locale functions in %s on line %d
|
||||
ÄÖÜ
|
||||
|
||||
Reference in New Issue
Block a user