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