xref: /PHP-8.0/ext/mbstring/tests/bug77454.phpt (revision db4f5e44)
1--TEST--
2Bug #77454: mb_scrub() silently truncates after a null byte
3--SKIPIF--
4<?php require 'skipif.inc'; ?>
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