1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Files
archived-php-src/ext/mbstring/tests/bug77454.phpt
2021-06-11 14:00:43 +02:00

19 lines
344 B
PHP

--TEST--
Bug #77454: mb_scrub() silently truncates after a null byte
--EXTENSIONS--
mbstring
--FILE--
<?php
$str = "before\0after";
function test($str, $enc) {
echo str_replace("\0", '\0', mb_scrub($str, $enc)), "\n";
}
test($str, 'latin1');
test($str, 'utf-8');
test($str, 'ascii');
?>
--EXPECT--
before\0after
before\0after
before\0after