summaryrefslogtreecommitdiff
path: root/ext/json/tests
diff options
context:
space:
mode:
authorJakub Zelenka <bukka@php.net>2015-06-28 17:16:12 +0100
committerJakub Zelenka <bukka@php.net>2015-06-28 17:16:12 +0100
commit64c371142cbdb82eb0879d247430797d73a8ac2d (patch)
tree280612b73745c40b0c838f2b8797eac712b72367 /ext/json/tests
parent695b4f4cad83c90f928af8a1c227defd5c6ca63c (diff)
downloadphp-git-64c371142cbdb82eb0879d247430797d73a8ac2d.tar.gz
Fix bug #62010 (json_decode produces invalid byte-sequences)
Diffstat (limited to 'ext/json/tests')
-rw-r--r--ext/json/tests/bug62010.phpt15
1 files changed, 15 insertions, 0 deletions
diff --git a/ext/json/tests/bug62010.phpt b/ext/json/tests/bug62010.phpt
new file mode 100644
index 0000000000..ddac8963c3
--- /dev/null
+++ b/ext/json/tests/bug62010.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Bug #62010 (json_decode produces invalid byte-sequences)
+--SKIPIF--
+<?php if (!extension_loaded("json")) print "skip"; ?>
+--FILE--
+<?php
+
+var_dump(json_decode('"\ud834"'));
+var_dump(json_last_error() === JSON_ERROR_UTF16);
+var_dump(json_last_error_msg());
+?>
+--EXPECTF--
+NULL
+bool(true)
+string(50) "Single unpaired UTF-16 surrogate in unicode escape"