i = myht ? zend_hash_num_elements(myht) : 0;
if (i > 0) {
zend_string *key;
- ulong index, idx;
+ php_uint_t index, idx;
idx = 0;
ZEND_HASH_FOREACH_KEY(myht, index, key) {
if (i > 0) {
zend_string *key;
zval *data;
- ulong index;
+ php_uint_t index;
HashTable *tmp_ht;
ZEND_HASH_FOREACH_KEY_VAL_IND(myht, index, key, data) {
json_pretty_print_indent(buf, options TSRMLS_CC);
smart_str_appendc(buf, '"');
- smart_str_append_int(buf, (long) index);
+ smart_str_append_int(buf, (php_int_t) index);
smart_str_appendc(buf, '"');
smart_str_appendc(buf, ':');
if (options & PHP_JSON_NUMERIC_CHECK) {
double d;
int type;
- long p;
+ php_int_t p;
if ((type = is_numeric_string(s, len, &p, &d, 0)) != 0) {
if (type == IS_INT) {
}
/* }}} */
-PHP_JSON_API void php_json_decode_ex(zval *return_value, char *str, int str_len, int options, long depth TSRMLS_DC) /* {{{ */
+PHP_JSON_API void php_json_decode_ex(zval *return_value, char *str, int str_len, int options, php_int_t depth TSRMLS_DC) /* {{{ */
{
int utf16_len;
unsigned short *utf16;
if (!parse_JSON_ex(jp, return_value, utf16, utf16_len, options TSRMLS_CC)) {
double d;
int type, overflow_info;
- long p;
+ php_int_t p;
char *trim = str;
int trim_len = str_len;
{
zval *parameter;
smart_str buf = {0};
- long options = 0;
- long depth = JSON_PARSER_DEFAULT_DEPTH;
+ php_int_t options = 0;
+ php_int_t depth = JSON_PARSER_DEFAULT_DEPTH;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|ll", ¶meter, &options, &depth) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|ii", ¶meter, &options, &depth) == FAILURE) {
return;
}
char *str;
int str_len;
zend_bool assoc = 0; /* return JS objects as PHP objects by default */
- long depth = JSON_PARSER_DEFAULT_DEPTH;
- long options = 0;
+ php_int_t depth = JSON_PARSER_DEFAULT_DEPTH;
+ php_int_t options = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|bll", &str, &str_len, &assoc, &depth, &options) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|bii", &str, &str_len, &assoc, &depth, &options) == FAILURE) {
return;
}
#endif
PHP_JSON_API void php_json_encode(smart_str *buf, zval *val, int options TSRMLS_DC);
-PHP_JSON_API void php_json_decode_ex(zval *return_value, char *str, int str_len, int options, long depth TSRMLS_DC);
+PHP_JSON_API void php_json_decode_ex(zval *return_value, char *str, int str_len, int options, php_int_t depth TSRMLS_DC);
extern PHP_JSON_API zend_class_entry *php_json_serializable_ce;
#define PHP_JSON_OBJECT_AS_ARRAY (1<<0)
#define PHP_JSON_BIGINT_AS_STRING (1<<1)
-static inline void php_json_decode(zval *return_value, char *str, int str_len, zend_bool assoc, long depth TSRMLS_DC)
+static inline void php_json_decode(zval *return_value, char *str, int str_len, zend_bool assoc, php_int_t depth TSRMLS_DC)
{
php_json_decode_ex(return_value, str, str_len, assoc ? PHP_JSON_OBJECT_AS_ARRAY : 0, depth TSRMLS_CC);
}