summaryrefslogtreecommitdiff
path: root/ext/json/tests
diff options
context:
space:
mode:
authorHugo Fonseca <hugo.fonseca@beubi.com>2015-03-07 10:53:31 +0000
committerHugo Fonseca <hugo.fonseca@beubi.com>2015-03-07 10:53:31 +0000
commitbaece8539971b74e6c6258bda3312cf6cd121643 (patch)
treef7fa429aa55ed2d91bfd71b5a3c781cf96fca2fc /ext/json/tests
parentf1d1273f2b580d5328497f7d59e5c25e6259354e (diff)
downloadphp-git-baece8539971b74e6c6258bda3312cf6cd121643.tar.gz
Added test for bug 69187
Diffstat (limited to 'ext/json/tests')
-rw-r--r--ext/json/tests/bug69187.phpt33
1 files changed, 33 insertions, 0 deletions
diff --git a/ext/json/tests/bug69187.phpt b/ext/json/tests/bug69187.phpt
new file mode 100644
index 0000000000..bc1883e605
--- /dev/null
+++ b/ext/json/tests/bug69187.phpt
@@ -0,0 +1,33 @@
+--TEST--
+Bug #69187 json_last_error return BC in PHP7
+--SKIPIF--
+<?php if (!extension_loaded("json")) print "skip"; ?>
+--FILE--
+<?php
+var_dump(json_decode(NULL));
+var_dump(json_last_error());
+var_dump(json_decode(FALSE));
+var_dump(json_last_error());
+var_dump(json_decode(""));
+var_dump(json_last_error());
+
+var_dump(json_decode(0));
+var_dump(json_last_error());
+var_dump(json_decode(1));
+var_dump(json_last_error());
+var_dump(json_decode(TRUE));
+var_dump(json_last_error());
+?>
+--EXPECT--
+NULL
+int(4)
+NULL
+int(4)
+NULL
+int(4)
+int(0)
+int(0)
+int(1)
+int(0)
+int(1)
+int(0)