summaryrefslogtreecommitdiff
path: root/ext/mbstring/tests/bug77454.phpt
blob: 74098580f15046fd3fc31aa8d793589a09cbff40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
--TEST--
Bug #77454: mb_scrub() silently truncates after a null byte
--SKIPIF--
<?php require 'skipif.inc'; ?>
--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