xref: /PHP-8.0/ext/json/tests/bug43941.phpt (revision 32a1ebbd)
1--TEST--
2Bug #43941 (json_encode() invalid UTF-8)
3--FILE--
4<?php
5
6var_dump(json_encode("abc"));
7var_dump(json_encode("ab\xE0"));
8var_dump(json_encode("ab\xE0", JSON_PARTIAL_OUTPUT_ON_ERROR));
9var_dump(json_encode(array("ab\xE0", "ab\xE0c", "abc"), JSON_PARTIAL_OUTPUT_ON_ERROR));
10
11echo "Done\n";
12?>
13--EXPECT--
14string(5) ""abc""
15bool(false)
16string(4) "null"
17string(17) "[null,null,"abc"]"
18Done
19