summaryrefslogtreecommitdiff
path: root/ext/json
diff options
context:
space:
mode:
authorSVN Migration <svn@php.net>2008-12-03 20:30:45 +0000
committerSVN Migration <svn@php.net>2008-12-03 20:30:45 +0000
commit2876046398950e59c3b3c460e67e6fec7ff2ba3c (patch)
tree33b2b8b4b859960a6446ad19d0ada1c55f9cfcda /ext/json
parent3fb86b0b9e79e6a3312b694f30ee627e2e1b325c (diff)
downloadphp-git-php-5.3.0alpha2.tar.gz
This commit was manufactured by cvs2svn to create tag 'php_5_3_0alpha2'.php-5.3.0alpha2
Diffstat (limited to 'ext/json')
-rw-r--r--ext/json/JSON_parser.c2
-rw-r--r--ext/json/json.c5
-rw-r--r--ext/json/tests/bug41567.phpt2
3 files changed, 3 insertions, 6 deletions
diff --git a/ext/json/JSON_parser.c b/ext/json/JSON_parser.c
index a90ade02de..1a3bd21e55 100644
--- a/ext/json/JSON_parser.c
+++ b/ext/json/JSON_parser.c
@@ -285,7 +285,7 @@ static void json_create_zval(zval **z, smart_str *buf, int type)
if (type == IS_LONG)
{
double d = zend_strtod(buf->c, NULL);
- if (d > LONG_MAX || d < LONG_MIN) {
+ if (d > LONG_MAX || d < -LONG_MAX) {
ZVAL_DOUBLE(*z, d);
} else {
ZVAL_LONG(*z, (long)d);
diff --git a/ext/json/json.c b/ext/json/json.c
index b52b3ff5f3..c130105ae8 100644
--- a/ext/json/json.c
+++ b/ext/json/json.c
@@ -42,10 +42,12 @@ static const char digits[] = "0123456789abcdef";
#define PHP_JSON_HEX_QUOT (1<<3)
/* {{{ arginfo */
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_json_encode, 0, 0, 1)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO()
+static
ZEND_BEGIN_ARG_INFO_EX(arginfo_json_decode, 0, 0, 1)
ZEND_ARG_INFO(0, json)
ZEND_ARG_INFO(0, assoc)
@@ -209,9 +211,6 @@ static void json_encode_array(smart_str *buf, zval **val, int options TSRMLS_DC)
if (i == HASH_KEY_IS_STRING) {
if (key[0] == '\0' && Z_TYPE_PP(val) == IS_OBJECT) {
/* Skip protected and private members. */
- if (tmp_ht) {
- tmp_ht->nApplyCount--;
- }
continue;
}
diff --git a/ext/json/tests/bug41567.phpt b/ext/json/tests/bug41567.phpt
index a253a47b7a..5553df397c 100644
--- a/ext/json/tests/bug41567.phpt
+++ b/ext/json/tests/bug41567.phpt
@@ -1,7 +1,5 @@
--TEST--
Bug #41567 (json_encode() double conversion is inconsistent with PHP)
---INI--
-precision=14
--SKIPIF--
<?php if (!extension_loaded('json')) print 'skip'; ?>
--FILE--