xref: /PHP-7.2/ext/mbstring/tests/bug77454.phpt (revision 3ad0ebdf)
1--TEST--
2Bug #77454: mb_scrub() silently truncates after a null byte
3--FILE--
4<?php
5$str = "before\0after";
6function test($str, $enc) {
7    echo str_replace("\0", '\0', mb_scrub($str, $enc)), "\n";
8}
9test($str, 'latin1');
10test($str, 'utf-8');
11test($str, 'ascii');
12?>
13--EXPECT--
14before\0after
15before\0after
16before\0after
17