Skip to content

Commit a860354

Browse files
authored
Merge pull request #78 from TysonAndre/2.1.0-dev-changes
2.1.0dev changes: Allow parsing numbers outside of the int64/uint64/double ranges
2 parents c0034f2 + 03fec36 commit a860354

42 files changed

Lines changed: 4240 additions & 219 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.appveyor.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,22 +37,22 @@ environment:
3737
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
3838
ARCH: x86
3939
VC: vs16
40-
PHP_VER: 8.2.0beta2
40+
PHP_VER: 8.2.0RC3
4141
TS: 1
4242
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
4343
ARCH: x64
4444
VC: vs16
45-
PHP_VER: 8.2.0beta2
45+
PHP_VER: 8.2.0RC3
4646
TS: 0
4747
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
4848
ARCH: x64
4949
VC: vs16
50-
PHP_VER: 8.1.9
50+
PHP_VER: 8.1.11
5151
TS: 0
5252
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
5353
ARCH: x64
5454
VC: vs16
55-
PHP_VER: 8.0.22
55+
PHP_VER: 8.0.24
5656
TS: 0
5757
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
5858
ARCH: x64

.github/workflows/integration.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ jobs:
104104
- "7.3"
105105
- "7.4"
106106
- "8.0"
107+
- "8.1"
107108
os: [ubuntu-latest]
108109
experimental: [false]
109110
runs-on: ${{ matrix.os }}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ modules/
3232
*.dep
3333
php_test_results_*.txt
3434
tests/*
35-
!tests/*.phpt
35+
!tests/**/*.phpt
3636
!tests/_files/
3737
*~
3838
configure.ac

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,36 +109,36 @@ var_dump($res) //int(5)
109109
/**
110110
* Similar to json_decode()
111111
*
112-
* @returns array|stdClass|string|float|int|bool|null
112+
* @return array|stdClass|string|float|int|bool|null
113113
* @throws RuntimeException for invalid JSON (or document over 4GB, or out of range integer/float)
114114
*/
115115
function simdjson_decode(string $json, bool $assoc = false, int $depth = 512) {}
116116

117117
/**
118118
* Returns true if json is valid.
119119
*
120-
* @returns ?bool (null if depth is invalid)
120+
* @return ?bool (null if depth is invalid)
121121
*/
122122
function simdjson_is_valid(string $json, int $depth = 512) : ?bool {}
123123

124124
/**
125125
* Parses $json and returns the number of keys in $json matching the JSON pointer $key
126126
*
127-
* @returns ?bool (null if depth is invalid)
127+
* @return ?int (null if depth is invalid)
128128
*/
129129
function simdjson_key_count(string $json, string $key, int $depth = 512) : ?int {}
130130

131131
/**
132132
* Returns true if the JSON pointer $key could be found.
133133
*
134-
* @returns ?bool (null if depth is invalid, false if json is invalid or key is not found)
134+
* @return ?bool (null if depth is invalid, false if json is invalid or key is not found)
135135
*/
136136
function simdjson_key_exists(string $json, string $key, int $depth = 512) : ?bool {}
137137

138138
/**
139139
* Returns the value at $key
140140
*
141-
* @returns array|stdClass|string|float|int|bool|null the value at $key
141+
* @return array|stdClass|string|float|int|bool|null the value at $key
142142
* @throws RuntimeException for invalid JSON (or document over 4GB, or out of range integer/float)
143143
*/
144144
function simdjson_key_value(string $json, string $key, bool $assoc = unknown, int $depth = unknown) {}
@@ -148,7 +148,7 @@ function simdjson_key_value(string $json, string $key, bool $assoc = unknown, in
148148

149149
There are some differences from `json_decode()` due to the implementation of the underlying simdjson library. This will throw a RuntimeException if simdjson rejects the JSON.
150150

151-
1) `simdjson_decode()` how out of range 64-bit integers and floats are handled.
151+
1) **Until simdjson 2.1.0,** `simdjson_decode()` differed in how out of range 64-bit integers and floats are handled.
152152

153153
See https://github.com/simdjson/simdjson/blob/master/doc/basics.md#standard-compliance
154154

config.m4

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,15 @@ if test "$PHP_SIMDJSON" != "no"; then
2929
[CXXFLAGS="$CXXFLAGS -fvisibility=hidden"])
3030

3131
AC_DEFINE(HAVE_SIMDJSON, 1, [whether simdjson is enabled])
32+
dnl Disable exceptions because PHP is written in C and loads this C++ module, handle errors manually.
33+
dnl Disable development checks of C simdjson library in php debug builds (can manually override)
3234
PHP_NEW_EXTENSION(simdjson, [
3335
php_simdjson.cpp \
3436
src/bindings.cpp \
3537
src/simdjson.cpp],
36-
$ext_shared,, "-std=c++17 -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1", cxx)
38+
$ext_shared,, "-std=c++17 -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -DSIMDJSON_EXCEPTIONS=0 -DSIMDJSON_DEVELOPMENT_CHECKS=0", cxx)
3739

38-
PHP_INSTALL_HEADERS([ext/simdjson], [php_simdjson.h])
40+
PHP_INSTALL_HEADERS([ext/simdjson], [php_simdjson.h, src/bindings.h src/bindings_defs.h])
3941
PHP_ADD_MAKEFILE_FRAGMENT
4042
PHP_ADD_BUILD_DIR(src, 1)
4143
fi

config.w32

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ if (PHP_SIMDJSON == "yes") {
1111
'/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 /std:c++latest');
1212
ADD_SOURCES(configure_module_dirname + '/src', 'simdjson.cpp bindings.cpp', 'simdjson');
1313
ADD_FLAG('CFLAGS_SIMDJSON', '/I' + configure_module_dirname);
14-
PHP_INSTALL_HEADERS('ext/simdjson', 'php_simdjson.h');
14+
PHP_INSTALL_HEADERS('ext/simdjson', 'php_simdjson.h src/bindings.h src/bindings_defs.h');
1515
}
1616
// vim:ft=javascript

package.xml

Lines changed: 52 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,23 @@
2020
-->
2121
<date>2022-10-12</date>
2222
<version>
23-
<release>2.0.5</release>
24-
<api>2.0.5</api>
23+
<release>2.1.0dev</release>
24+
<api>2.1.0dev</api>
2525
</version>
2626
<stability>
2727
<release>stable</release>
2828
<api>stable</api>
2929
</stability>
3030
<license uri="https://www.apache.org/licenses/LICENSE-2.0.html">Apache 2.0</license>
3131
<notes>
32-
* Reuse PHP's 1-byte and 0-byte interned strings in simdjson_decode, reducing memory usage for those strings. (e.g. for the key/value in '{"x":""}')
33-
* Return correct count in simdjson_key_count. Properly return counts larger than 0xFFFFFF instead of returning 0xFFFFFF.
32+
* Allow out of range 64-bit values in JSON integer syntax and allow floating point values outside of the max/min finite floating point values (i.e. parsing to +/- infinity).
33+
34+
This allows simdjson_decode() to be used as a replacement for json_decode() in more use cases.
35+
* Return the correct value in simdjson_key_count() for JSON pointers to arrays/objects exceeding size 0xFFFFFF.
36+
Previously, this would be limited to returning at most 0xFFFFFF(16777215).
37+
* Throw 'SimdJsonException extends RuntimeException' instead of RuntimeException.
38+
* Set the error code from simdjson as SimdJsonException->getCode()
39+
* Expose error_code constants from simdjson as `SIMDJSON_ERR_$ERRCODENAME`
3440
</notes>
3541
<contents>
3642
<dir name="/">
@@ -42,9 +48,12 @@
4248
<file name="php_simdjson.h" role="src"/>
4349
<file name="php_simdjson.cpp" role="src"/>
4450
<file name="README.md" role="doc"/>
51+
<file name="simdjson.stub.php" role="src"/>
52+
<file name="simdjson_arginfo.h" role="src"/>
4553
<dir name="src">
4654
<file name="bindings.cpp" role="src"/>
4755
<file name="bindings.h" role="src"/>
56+
<file name="bindings_defs.h" role="src"/>
4857
<file name="simdjson.cpp" role="src"/>
4958
<file name="simdjson.h" role="src"/>
5059
</dir>
@@ -67,7 +76,6 @@
6776
<file name="key_count.phpt" role="test"/>
6877
<file name="key_count_args.phpt" role="test"/>
6978
<file name="key_count_exception.phpt" role="test"/>
70-
<file name="key_count_large.phpt" role="test"/>
7179
<file name="key_exists.phpt" role="test"/>
7280
<file name="key_exists_args.phpt" role="test"/>
7381
<file name="key_value_args.phpt" role="test"/>
@@ -77,6 +85,30 @@
7785
<file name="key_value_result.phpt" role="test"/>
7886
<file name="uint64_overflow.phpt" role="test"/>
7987
<file name="_files/result.json" role="test"/>
88+
<dir name="compat">
89+
<file name="001.phpt" role="test"/>
90+
<file name="bug41067.phpt" role="test"/>
91+
<file name="bug41504.phpt" role="test"/>
92+
<file name="bug45791.phpt" role="test"/>
93+
<file name="bug47644.phpt" role="test"/>
94+
<file name="bug50224.phpt" role="test"/>
95+
<file name="bug62010.phpt" role="test"/>
96+
<file name="bug64874_part1.phpt" role="test"/>
97+
<file name="bug64874_part2.phpt" role="test"/>
98+
<file name="bug68546.phpt" role="test"/>
99+
<file name="bug68817.phpt" role="test"/>
100+
<file name="bug68938.phpt" role="test"/>
101+
<file name="bug69187.phpt" role="test"/>
102+
<file name="fail001.phpt" role="test"/>
103+
<file name="json_decode_basic.phpt" role="test"/>
104+
<file name="json_decode_error.phpt" role="test"/>
105+
<file name="json_decode_invalid_utf8.phpt" role="test"/>
106+
<file name="pass001.1_64bit.phpt" role="test"/>
107+
<file name="pass001.1.phpt" role="test"/>
108+
<file name="pass001.phpt" role="test"/>
109+
<file name="pass002.phpt" role="test"/>
110+
<file name="pass003.phpt" role="test"/>
111+
</dir>
80112
</dir>
81113
</dir>
82114
</contents>
@@ -93,6 +125,21 @@
93125
<providesextension>simdjson</providesextension>
94126
<extsrcrelease/>
95127
<changelog>
128+
<release>
129+
<date>2022-10-01</date>
130+
<version>
131+
<release>2.0.5</release>
132+
<api>2.0.5</api>
133+
</version>
134+
<stability>
135+
<release>stable</release>
136+
<api>stable</api>
137+
</stability>
138+
<license uri="https://www.apache.org/licenses/LICENSE-2.0.html">Apache 2.0</license>
139+
<notes>
140+
* Reuse PHP's 1-byte and 0-byte interned strings in simdjson_decode, reducing memory usage for those strings. (e.g. for the key/value in '{"x":""}')
141+
</notes>
142+
</release>
96143
<release>
97144
<date>2022-10-01</date>
98145
<version>

php_simdjson.cpp

Lines changed: 58 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,17 @@ extern "C" {
2020
#include "zend_exceptions.h"
2121
#include "main/SAPI.h"
2222
#include "ext/standard/info.h"
23+
#include "ext/spl/spl_exceptions.h"
2324

2425
#include "php_simdjson.h"
26+
#include "simdjson_arginfo.h"
2527
}
2628

29+
// Both the declaration and the definition of ZEND_API variables, functions must be within an 'extern "C"' block for Windows?
30+
zend_class_entry *simdjson_exception_ce;
31+
2732
#include "src/bindings.h"
33+
#include "src/simdjson.h"
2834

2935
ZEND_DECLARE_MODULE_GLOBALS(simdjson);
3036

@@ -66,29 +72,15 @@ SIMDJSON_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(simdjson_key_count_arginfo, 0,
6672
ZEND_ARG_TYPE_INFO(0, depth, IS_LONG, 0)
6773
ZEND_END_ARG_INFO()
6874

69-
extern simdjson::dom::parser* cplus_simdjson_create_parser(void);
70-
71-
extern void cplus_simdjson_free_parser(simdjson::dom::parser* parser);
72-
73-
extern bool cplus_simdjson_is_valid(simdjson::dom::parser& parser, const char *json, size_t len, size_t depth);
74-
75-
extern void cplus_simdjson_parse(simdjson::dom::parser& parser, const char *json, size_t len, zval *return_value, unsigned char assoc, size_t depth);
76-
77-
extern void cplus_simdjson_key_value(simdjson::dom::parser& parser, const char *json, size_t len, const char *key, zval *return_value, unsigned char assoc, size_t depth);
78-
79-
extern u_short cplus_simdjson_key_exists(simdjson::dom::parser& parser, const char *json, size_t len, const char *key, size_t depth);
80-
81-
extern void cplus_simdjson_key_count(simdjson::dom::parser& parser, const char *json, size_t len, const char *key, zval *return_value, size_t depth);
82-
8375
#define SIMDJSON_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(simdjson, v)
84-
static simdjson::dom::parser &simdjson_get_parser() {
85-
simdjson::dom::parser *parser = (simdjson::dom::parser *)SIMDJSON_G(parser);
76+
static simdjson_php_parser *simdjson_get_parser() {
77+
simdjson_php_parser *parser = SIMDJSON_G(parser);
8678
if (parser == NULL) {
8779
parser = cplus_simdjson_create_parser();
8880
SIMDJSON_G(parser) = parser;
8981
ZEND_ASSERT(parser != NULL);
9082
}
91-
return *parser;
83+
return parser;
9284
}
9385

9486
// The simdjson parser accepts strings with at most 32-bit lengths, for now.
@@ -128,7 +120,10 @@ PHP_FUNCTION (simdjson_decode) {
128120
if (!simdjson_validate_depth(depth)) {
129121
RETURN_NULL();
130122
}
131-
cplus_simdjson_parse(simdjson_get_parser(), ZSTR_VAL(json), ZSTR_LEN(json), return_value, assoc, depth);
123+
simdjson_php_error_code error = cplus_simdjson_parse(simdjson_get_parser(), ZSTR_VAL(json), ZSTR_LEN(json), return_value, assoc, depth);
124+
if (error) {
125+
cplus_simdjson_throw_jsonexception(error);
126+
}
132127
}
133128

134129
PHP_FUNCTION (simdjson_key_value) {
@@ -143,7 +138,10 @@ PHP_FUNCTION (simdjson_key_value) {
143138
if (!simdjson_validate_depth(depth)) {
144139
RETURN_NULL();
145140
}
146-
cplus_simdjson_key_value(simdjson_get_parser(), ZSTR_VAL(json), ZSTR_LEN(json), ZSTR_VAL(key), return_value, assoc, depth);
141+
simdjson_php_error_code error = cplus_simdjson_key_value(simdjson_get_parser(), ZSTR_VAL(json), ZSTR_LEN(json), ZSTR_VAL(key), return_value, assoc, depth);
142+
if (error) {
143+
cplus_simdjson_throw_jsonexception(error);
144+
}
147145
}
148146

149147
PHP_FUNCTION (simdjson_key_count) {
@@ -156,7 +154,10 @@ PHP_FUNCTION (simdjson_key_count) {
156154
if (!simdjson_validate_depth(depth)) {
157155
RETURN_NULL();
158156
}
159-
cplus_simdjson_key_count(simdjson_get_parser(), ZSTR_VAL(json), ZSTR_LEN(json), ZSTR_VAL(key), return_value, depth);
157+
simdjson_php_error_code error = cplus_simdjson_key_count(simdjson_get_parser(), ZSTR_VAL(json), ZSTR_LEN(json), ZSTR_VAL(key), return_value, depth);
158+
if (error) {
159+
cplus_simdjson_throw_jsonexception(error);
160+
}
160161
}
161162

162163
PHP_FUNCTION (simdjson_key_exists) {
@@ -202,7 +203,42 @@ ZEND_TSRMLS_CACHE_UPDATE();
202203

203204
/** {{{ PHP_MINIT_FUNCTION
204205
*/
206+
#define SIMDJSON_REGISTER_ERROR_CODE_CONSTANT(errcode) REGISTER_LONG_CONSTANT("SIMDJSON_ERR_" #errcode, simdjson::errcode, CONST_PERSISTENT)
207+
#define SIMDJSON_REGISTER_CUSTOM_ERROR_CODE_CONSTANT(errcode, val) REGISTER_LONG_CONSTANT("SIMDJSON_ERR_" #errcode, (val), CONST_PERSISTENT)
205208
PHP_MINIT_FUNCTION (simdjson) {
209+
simdjson_exception_ce = register_class_SimdJsonException(spl_ce_RuntimeException);
210+
SIMDJSON_REGISTER_ERROR_CODE_CONSTANT(CAPACITY); ///< This parser can't support a document that big
211+
// SIMDJSON_REGISTER_ERROR_CODE_CONSTANT(MEMALLOC); ///< Error allocating memory, most likely out of memory
212+
SIMDJSON_REGISTER_ERROR_CODE_CONSTANT(TAPE_ERROR); ///< Something went wrong, this is a generic error
213+
SIMDJSON_REGISTER_ERROR_CODE_CONSTANT(DEPTH_ERROR); ///< Your document exceeds the user-specified depth limitation
214+
SIMDJSON_REGISTER_ERROR_CODE_CONSTANT(STRING_ERROR); ///< Problem while parsing a string
215+
SIMDJSON_REGISTER_ERROR_CODE_CONSTANT(T_ATOM_ERROR); ///< Problem while parsing an atom starting with the letter 't'
216+
SIMDJSON_REGISTER_ERROR_CODE_CONSTANT(F_ATOM_ERROR); ///< Problem while parsing an atom starting with the letter 'f'
217+
SIMDJSON_REGISTER_ERROR_CODE_CONSTANT(N_ATOM_ERROR); ///< Problem while parsing an atom starting with the letter 'n'
218+
SIMDJSON_REGISTER_ERROR_CODE_CONSTANT(NUMBER_ERROR); ///< Problem while parsing a number
219+
SIMDJSON_REGISTER_ERROR_CODE_CONSTANT(UTF8_ERROR); ///< the input is not valid UTF-8
220+
SIMDJSON_REGISTER_ERROR_CODE_CONSTANT(UNINITIALIZED); ///< unknown error, or uninitialized document
221+
SIMDJSON_REGISTER_ERROR_CODE_CONSTANT(EMPTY); ///< no structural element found
222+
SIMDJSON_REGISTER_ERROR_CODE_CONSTANT(UNESCAPED_CHARS); ///< found unescaped characters in a string.
223+
SIMDJSON_REGISTER_ERROR_CODE_CONSTANT(UNCLOSED_STRING); ///< missing quote at the end
224+
SIMDJSON_REGISTER_ERROR_CODE_CONSTANT(UNSUPPORTED_ARCHITECTURE); ///< unsupported architecture
225+
SIMDJSON_REGISTER_ERROR_CODE_CONSTANT(INCORRECT_TYPE); ///< JSON element has a different type than user expected
226+
SIMDJSON_REGISTER_ERROR_CODE_CONSTANT(NUMBER_OUT_OF_RANGE); ///< JSON number does not fit in 64 bits
227+
SIMDJSON_REGISTER_ERROR_CODE_CONSTANT(INDEX_OUT_OF_BOUNDS); ///< JSON array index too large
228+
SIMDJSON_REGISTER_ERROR_CODE_CONSTANT(NO_SUCH_FIELD); ///< JSON field not found in object
229+
SIMDJSON_REGISTER_ERROR_CODE_CONSTANT(IO_ERROR); ///< Error reading a file
230+
SIMDJSON_REGISTER_ERROR_CODE_CONSTANT(INVALID_JSON_POINTER); ///< Invalid JSON pointer reference
231+
SIMDJSON_REGISTER_ERROR_CODE_CONSTANT(INVALID_URI_FRAGMENT); ///< Invalid URI fragment
232+
SIMDJSON_REGISTER_ERROR_CODE_CONSTANT(UNEXPECTED_ERROR); ///< indicative of a bug in simdjson
233+
SIMDJSON_REGISTER_ERROR_CODE_CONSTANT(PARSER_IN_USE); ///< parser is already in use.
234+
SIMDJSON_REGISTER_ERROR_CODE_CONSTANT(OUT_OF_ORDER_ITERATION); ///< tried to iterate an array or object out of order
235+
SIMDJSON_REGISTER_ERROR_CODE_CONSTANT(INSUFFICIENT_PADDING); ///< The JSON doesn't have enough padding for simdjson to safely parse it.
236+
SIMDJSON_REGISTER_ERROR_CODE_CONSTANT(INCOMPLETE_ARRAY_OR_OBJECT); ///< The document ends early.
237+
SIMDJSON_REGISTER_ERROR_CODE_CONSTANT(SCALAR_DOCUMENT_AS_VALUE); ///< A scalar document is treated as a value.
238+
SIMDJSON_REGISTER_ERROR_CODE_CONSTANT(OUT_OF_BOUNDS); ///< Attempted to access location outside of document.
239+
SIMDJSON_REGISTER_ERROR_CODE_CONSTANT(TRAILING_CONTENT); ///< Unexpected trailing content in the JSON input
240+
SIMDJSON_REGISTER_CUSTOM_ERROR_CODE_CONSTANT(INVALID_PROPERTY, 255); ///< Invalid property
241+
206242
return SUCCESS;
207243
}
208244
/* }}} */
@@ -225,9 +261,9 @@ PHP_RINIT_FUNCTION (simdjson) {
225261
/** {{{ PHP_RSHUTDOWN_FUNCTION
226262
*/
227263
PHP_RSHUTDOWN_FUNCTION (simdjson) {
228-
void *parser = SIMDJSON_G(parser);
264+
simdjson_php_parser *parser = SIMDJSON_G(parser);
229265
if (parser != NULL) {
230-
cplus_simdjson_free_parser((simdjson::dom::parser *) parser);
266+
cplus_simdjson_free_parser(parser);
231267
SIMDJSON_G(parser) = NULL;
232268
}
233269
return SUCCESS;

php_simdjson.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
extern zend_module_entry simdjson_module_entry;
1818
#define phpext_simdjson_ptr &simdjson_module_entry
1919

20-
#define PHP_SIMDJSON_VERSION "2.0.5"
20+
#define PHP_SIMDJSON_VERSION "2.1.0dev"
2121
#define SIMDJSON_SUPPORT_URL "https://github.com/crazyxman/simdjson_php"
2222
#define SIMDJSON_PARSE_FAIL 0
2323
#define SIMDJSON_PARSE_SUCCESS 1
@@ -26,17 +26,20 @@ extern zend_module_entry simdjson_module_entry;
2626

2727
#define SIMDJSON_PARSE_DEFAULT_DEPTH 512
2828

29-
30-
extern PHPAPI void php_var_dump(zval **struc, int level);
31-
extern PHPAPI void php_debug_zval_dump(zval **struc, int level);
29+
/*
30+
* NOTE: Namespaces and references(&) are C++ only functionality.
31+
* To expose this functionality to other C PECLs,
32+
* switch to a forward class declaration of a class that only wraps simdjson::dom::parser
33+
*/
34+
class simdjson_php_parser;
3235

3336
ZEND_BEGIN_MODULE_GLOBALS(simdjson)
3437
/*
3538
* php::simdjson::parser pointer, constructed on first use with request-scope lifetime.
3639
* Note that in ZTS builds, the thread for each request will deliberately have different instances for each concurrently running request.
3740
* (The simdjson library is not thread safe)
3841
*/
39-
void *parser;
42+
simdjson_php_parser *parser;
4043
ZEND_END_MODULE_GLOBALS(simdjson)
4144

4245
PHP_MINIT_FUNCTION(simdjson);

0 commit comments

Comments
 (0)