xref: /PHP-5.4/ext/json/tests/bug43941.phpt (revision bcc87ba6)
1--TEST--
2Bug #43941 (json_encode() invalid UTF-8)
3--SKIPIF--
4<?php if (!extension_loaded("json")) print "skip"; ?>
5--FILE--
6<?php
7
8var_dump(json_encode("abc"));
9var_dump(json_encode("ab\xE0"));
10var_dump(json_encode("ab\xE0c"));
11var_dump(json_encode(array("ab\xE0", "ab\xE0c", "abc")));
12
13echo "Done\n";
14?>
15--EXPECTF--
16string(5) ""abc""
17string(4) "null"
18string(4) "null"
19string(17) "[null,null,"abc"]"
20Done
21
22