Lines Matching refs:options
57 ZEND_ARG_INFO(0, options)
65 ZEND_ARG_INFO(0, options)
179 static void json_escape_string(smart_str *buf, char *s, int len, int options TSRMLS_DC);
218 static inline void json_pretty_print_char(smart_str *buf, int options, char c TSRMLS_DC) /* {{{ */ in json_pretty_print_char() argument
220 if (options & PHP_JSON_PRETTY_PRINT) { in json_pretty_print_char()
226 static inline void json_pretty_print_indent(smart_str *buf, int options TSRMLS_DC) /* {{{ */ in json_pretty_print_indent()
230 if (options & PHP_JSON_PRETTY_PRINT) { in json_pretty_print_indent()
240 static void json_encode_array(smart_str *buf, zval **val, int options TSRMLS_DC) /* {{{ */ in json_encode_array()
247 …r = (options & PHP_JSON_FORCE_OBJECT) ? PHP_JSON_OUTPUT_OBJECT : json_determine_array_type(val TSR… in json_encode_array()
297 json_pretty_print_char(buf, options, '\n' TSRMLS_CC); in json_encode_array()
298 json_pretty_print_indent(buf, options TSRMLS_CC); in json_encode_array()
299 php_json_encode(buf, *data, options TSRMLS_CC); in json_encode_array()
316 json_pretty_print_char(buf, options, '\n' TSRMLS_CC); in json_encode_array()
317 json_pretty_print_indent(buf, options TSRMLS_CC); in json_encode_array()
319 json_escape_string(buf, key, key_len - 1, options & ~PHP_JSON_NUMERIC_CHECK TSRMLS_CC); in json_encode_array()
322 json_pretty_print_char(buf, options, ' ' TSRMLS_CC); in json_encode_array()
324 php_json_encode(buf, *data, options TSRMLS_CC); in json_encode_array()
332 json_pretty_print_char(buf, options, '\n' TSRMLS_CC); in json_encode_array()
333 json_pretty_print_indent(buf, options TSRMLS_CC); in json_encode_array()
340 json_pretty_print_char(buf, options, ' ' TSRMLS_CC); in json_encode_array()
342 php_json_encode(buf, *data, options TSRMLS_CC); in json_encode_array()
360 json_pretty_print_char(buf, options, '\n' TSRMLS_CC); in json_encode_array()
361 json_pretty_print_indent(buf, options TSRMLS_CC); in json_encode_array()
410 static void json_escape_string(smart_str *buf, char *s, int len, int options TSRMLS_DC) /* {{{ */ in json_escape_string()
422 if (options & PHP_JSON_NUMERIC_CHECK) { in json_escape_string()
437 …if (options & PHP_JSON_PRESERVE_ZERO_FRACTION && strchr(num, '.') == NULL && l < NUM_BUF_SIZE - 2)… in json_escape_string()
449 …utf16 = (options & PHP_JSON_UNESCAPED_UNICODE) ? NULL : (unsigned short *) safe_emalloc(len, sizeo… in json_escape_string()
463 if (!(options & PHP_JSON_UNESCAPED_UNICODE)) { in json_escape_string()
473 us = (options & PHP_JSON_UNESCAPED_UNICODE) ? s[pos++] : utf16[pos++]; in json_escape_string()
478 if (options & PHP_JSON_HEX_QUOT) { in json_escape_string()
490 if (options & PHP_JSON_UNESCAPED_SLASHES) { in json_escape_string()
518 if (options & PHP_JSON_HEX_TAG) { in json_escape_string()
526 if (options & PHP_JSON_HEX_TAG) { in json_escape_string()
534 if (options & PHP_JSON_HEX_AMP) { in json_escape_string()
542 if (options & PHP_JSON_HEX_APOS) { in json_escape_string()
550 if (us >= ' ' && ((options & PHP_JSON_UNESCAPED_UNICODE) || (us & 127) == us)) { in json_escape_string()
571 static void json_encode_serializable_object(smart_str *buf, zval *val, int options TSRMLS_DC) /* {{… in json_encode_serializable_object()
609 json_encode_array(buf, &retval, options TSRMLS_CC); in json_encode_serializable_object()
612 php_json_encode(buf, retval, options TSRMLS_CC); in json_encode_serializable_object()
619 PHP_JSON_API void php_json_encode(smart_str *buf, zval *val, int options TSRMLS_DC) /* {{{ */ in php_json_encode()
648 …if (options & PHP_JSON_PRESERVE_ZERO_FRACTION && strchr(num, '.') == NULL && len < NUM_BUF_SIZE - … in php_json_encode()
662 json_escape_string(buf, Z_STRVAL_P(val), Z_STRLEN_P(val), options TSRMLS_CC); in php_json_encode()
667 json_encode_serializable_object(buf, val, options TSRMLS_CC); in php_json_encode()
672 json_encode_array(buf, &val, options TSRMLS_CC); in php_json_encode()
685 PHP_JSON_API void php_json_decode_ex(zval *return_value, char *str, int str_len, int options, long … in php_json_decode_ex() argument
717 if (parse_JSON_ex(jp, z, utf16, utf16_len, options TSRMLS_CC)) { in php_json_decode_ex()
757 if (options & PHP_JSON_BIGINT_AS_STRING && overflow_info) { in php_json_decode_ex()
806 long options = 0; in PHP_FUNCTION() local
809 …if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|ll", ¶meter, &options, &depth) == FAIL… in PHP_FUNCTION()
817 php_json_encode(&buf, parameter, options TSRMLS_CC); in PHP_FUNCTION()
819 if (JSON_G(error_code) != PHP_JSON_ERROR_NONE && !(options & PHP_JSON_PARTIAL_OUTPUT_ON_ERROR)) { in PHP_FUNCTION()
837 long options = 0; in PHP_FUNCTION() local
839 …ameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|bll", &str, &str_len, &assoc, &depth, &options) == FAILURE) { in PHP_FUNCTION()
851 options |= PHP_JSON_OBJECT_AS_ARRAY; in PHP_FUNCTION()
853 options &= ~PHP_JSON_OBJECT_AS_ARRAY; in PHP_FUNCTION()
856 php_json_decode_ex(return_value, str, str_len, options, depth TSRMLS_CC); in PHP_FUNCTION()