Coverage Report

Created: 2026-06-02 06:39

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/php-src/ext/json/php_json_encoder.h
Line
Count
Source
1
/*
2
  +----------------------------------------------------------------------+
3
  | Copyright © The PHP Group and Contributors.                          |
4
  +----------------------------------------------------------------------+
5
  | This source file is subject to the Modified BSD License that is      |
6
  | bundled with this package in the file LICENSE, and is available      |
7
  | through the World Wide Web at <https://www.php.net/license/>.        |
8
  |                                                                      |
9
  | SPDX-License-Identifier: BSD-3-Clause                                |
10
  +----------------------------------------------------------------------+
11
  | Author: Jakub Zelenka <bukka@php.net>                                |
12
  +----------------------------------------------------------------------+
13
*/
14
15
#ifndef PHP_JSON_ENCODER_H
16
#define PHP_JSON_ENCODER_H
17
18
#include "php.h"
19
#include "zend_smart_str.h"
20
21
typedef struct _php_json_encoder php_json_encoder;
22
23
struct _php_json_encoder {
24
  int depth;
25
  int max_depth;
26
  php_json_error_code error_code;
27
};
28
29
static inline void php_json_encode_init(php_json_encoder *encoder)
30
1.08k
{
31
1.08k
  memset(encoder, 0, sizeof(php_json_encoder));
32
1.08k
}
Unexecuted instantiation: json_encoder.c:php_json_encode_init
json.c:php_json_encode_init
Line
Count
Source
30
1.08k
{
31
1.08k
  memset(encoder, 0, sizeof(php_json_encoder));
32
1.08k
}
33
34
zend_result php_json_encode_zval(smart_str *buf, zval *val, int options, php_json_encoder *encoder);
35
36
zend_result php_json_escape_string(smart_str *buf, const char *s, size_t len, int options, php_json_encoder *encoder);
37
38
#endif  /* PHP_JSON_ENCODER_H */