summaryrefslogtreecommitdiff
path: root/ext/json/tests
diff options
context:
space:
mode:
authorAdam Harvey <aharvey@php.net>2015-02-02 11:12:27 +0000
committerAdam Harvey <aharvey@php.net>2015-02-02 11:12:27 +0000
commit9e20b64a5b97907fe557cc611535c697bab44a75 (patch)
treee86e871e76eca509e67e4c63dceda24869d7599f /ext/json/tests
parentc7eea5a79b684469020e66ce8a2999aaab54f875 (diff)
parentdb375cfd4dc2aabcd042c3a7cdd3c7faa479d557 (diff)
downloadphp-git-9e20b64a5b97907fe557cc611535c697bab44a75.tar.gz
Merge branch 'PHP-5.6'
Diffstat (limited to 'ext/json/tests')
-rw-r--r--ext/json/tests/bug54484.phpt9
-rw-r--r--ext/json/tests/bug68938.phpt11
2 files changed, 18 insertions, 2 deletions
diff --git a/ext/json/tests/bug54484.phpt b/ext/json/tests/bug54484.phpt
index d698ab5416..e56d8bd86b 100644
--- a/ext/json/tests/bug54484.phpt
+++ b/ext/json/tests/bug54484.phpt
@@ -15,11 +15,16 @@ json_decode("invalid json");
var_dump(json_last_error());
+json_decode("\001 invalid json");
+var_dump(json_last_error());
+
+
json_decode("");
var_dump(json_last_error());
?>
--EXPECT--
int(0)
-int(0)
int(4)
-int(0)
+int(4)
+int(3)
+int(4)
diff --git a/ext/json/tests/bug68938.phpt b/ext/json/tests/bug68938.phpt
new file mode 100644
index 0000000000..f6291ffe62
--- /dev/null
+++ b/ext/json/tests/bug68938.phpt
@@ -0,0 +1,11 @@
+--TEST--
+Bug #68938 (json_decode() decodes empty string without indicating error)
+--SKIPIF--
+<?php if (!extension_loaded("json")) print "skip"; ?>
+--FILE--
+<?php
+json_decode("");
+var_dump(json_last_error());
+?>
+--EXPECT--
+int(4)