Skip to content

Commit 8e4cefa

Browse files
authored
Merge pull request #1166 from jmikola/phpc-1631
PHPC-1631: Support PHP 8
2 parents 9fc51c8 + ca4c52e commit 8e4cefa

Some content is hidden

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

60 files changed

+518
-338
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ jobs:
101101
env:
102102
- CONFIGURE_OPTS="--with-mongodb-client-side-encryption=no"
103103

104+
# Test with upcoming PHP version
105+
- stage: Test
106+
php: nightly
107+
104108
before_install:
105109
- pip install --user "mongo-orchestration>=0.6.7,<1.0"
106110
- .travis.scripts/before_install.sh

bin/package.xml.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ necessary to build a fully-functional MongoDB driver.
5959
<required>
6060
<php>
6161
<min>7.0.0</min>
62-
<max>7.99.99</max>
62+
<max>8.99.99</max>
6363
</php>
6464
<pearinstaller>
6565
<min>1.4.8</min>

config.m4

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -33,47 +33,47 @@ if test "$PHP_MONGODB" != "no"; then
3333

3434
if test "$PHP_MONGODB_DEVELOPER_FLAGS" = "yes"; then
3535
dnl Warn about functions which might be candidates for format attributes
36-
PHP_CHECK_GCC_ARG(-Wmissing-format-attribute, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wmissing-format-attribute")
36+
AX_CHECK_COMPILE_FLAG(-Wmissing-format-attribute, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wmissing-format-attribute" ,, -Werror)
3737
dnl Avoid duplicating values for an enum
38-
PHP_CHECK_GCC_ARG(-Wduplicate-enum, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wduplicate-enum")
38+
AX_CHECK_COMPILE_FLAG(-Wduplicate-enum, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wduplicate-enum" ,, -Werror)
3939
dnl Warns on mismatches between #ifndef and #define header guards
40-
PHP_CHECK_GCC_ARG(-Wheader-guard, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wheader-guard")
40+
AX_CHECK_COMPILE_FLAG(-Wheader-guard, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wheader-guard" ,, -Werror)
4141
dnl logical not of a non-boolean expression
42-
PHP_CHECK_GCC_ARG(-Wlogical-not-parentheses, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wlogical-not-parentheses")
42+
AX_CHECK_COMPILE_FLAG(-Wlogical-not-parentheses, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wlogical-not-parentheses" ,, -Werror)
4343
dnl Warn about suspicious uses of logical operators in expressions
44-
PHP_CHECK_GCC_ARG(-Wlogical-op, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wlogical-op")
44+
AX_CHECK_COMPILE_FLAG(-Wlogical-op, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wlogical-op",, -Werror ,, -Werror)
4545
dnl memory error detector.
46-
dnl FIXME: -fsanitize=address,undefined for clang. The PHP_CHECK_GCC_ARG macro isn't happy about that string :(
47-
PHP_CHECK_GCC_ARG(-fsanitize-address, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -fsanitize-address")
46+
dnl FIXME: -fsanitize=address,undefined for clang. The AX_CHECK_COMPILE_FLAG macro isn't happy about that string :(
47+
AX_CHECK_COMPILE_FLAG(-fsanitize-address, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -fsanitize-address" ,, -Werror)
4848
dnl Enable frame debugging
49-
PHP_CHECK_GCC_ARG(-fno-omit-frame-pointer, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -fno-omit-frame-pointer")
49+
AX_CHECK_COMPILE_FLAG(-fno-omit-frame-pointer, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -fno-omit-frame-pointer" ,, -Werror)
5050
dnl Make sure we don't optimize calls
51-
PHP_CHECK_GCC_ARG(-fno-optimize-sibling-calls, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -fno-optimize-sibling-calls")
52-
PHP_CHECK_GCC_ARG(-Wlogical-op-parentheses, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wlogical-op-parentheses")
53-
PHP_CHECK_GCC_ARG(-Wpointer-bool-conversion, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wpointer-bool-conversion")
54-
PHP_CHECK_GCC_ARG(-Wbool-conversion, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wbool-conversion")
55-
PHP_CHECK_GCC_ARG(-Wloop-analysis, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wloop-analysis")
56-
PHP_CHECK_GCC_ARG(-Wsizeof-array-argument, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wsizeof-array-argument")
57-
PHP_CHECK_GCC_ARG(-Wstring-conversion, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wstring-conversion")
58-
PHP_CHECK_GCC_ARG(-Wno-variadic-macros, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-variadic-macros")
59-
PHP_CHECK_GCC_ARG(-Wno-sign-compare, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-sign-compare")
60-
PHP_CHECK_GCC_ARG(-fstack-protector, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -fstack-protector")
61-
PHP_CHECK_GCC_ARG(-fno-exceptions, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -fno-exceptions")
62-
PHP_CHECK_GCC_ARG(-Wformat-security, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wformat-security")
63-
PHP_CHECK_GCC_ARG(-Wformat-nonliteral, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wformat-nonliteral")
64-
PHP_CHECK_GCC_ARG(-Winit-self, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Winit-self")
65-
PHP_CHECK_GCC_ARG(-Wwrite-strings, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wwrite-strings")
66-
PHP_CHECK_GCC_ARG(-Wenum-compare, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wenum-compare")
67-
PHP_CHECK_GCC_ARG(-Wempty-body, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wempty-body")
68-
PHP_CHECK_GCC_ARG(-Wparentheses, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wparentheses")
69-
PHP_CHECK_GCC_ARG(-Wdeclaration-after-statement, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wdeclaration-after-statement")
70-
PHP_CHECK_GCC_ARG(-Wmaybe-uninitialized, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wmaybe-uninitialized")
71-
PHP_CHECK_GCC_ARG(-Wimplicit-fallthrough, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wimplicit-fallthrough")
72-
PHP_CHECK_GCC_ARG(-Werror, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Werror")
73-
PHP_CHECK_GCC_ARG(-Wextra, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wextra")
74-
PHP_CHECK_GCC_ARG(-Wno-unused-parameter, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-unused-parameter")
75-
PHP_CHECK_GCC_ARG(-Wno-unused-but-set-variable, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-unused-but-set-variable")
76-
PHP_CHECK_GCC_ARG(-Wno-missing-field-initializers, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-missing-field-initializers")
51+
AX_CHECK_COMPILE_FLAG(-fno-optimize-sibling-calls, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -fno-optimize-sibling-calls" ,, -Werror)
52+
AX_CHECK_COMPILE_FLAG(-Wlogical-op-parentheses, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wlogical-op-parentheses" ,, -Werror)
53+
AX_CHECK_COMPILE_FLAG(-Wpointer-bool-conversion, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wpointer-bool-conversion" ,, -Werror)
54+
AX_CHECK_COMPILE_FLAG(-Wbool-conversion, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wbool-conversion" ,, -Werror)
55+
AX_CHECK_COMPILE_FLAG(-Wloop-analysis, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wloop-analysis" ,, -Werror)
56+
AX_CHECK_COMPILE_FLAG(-Wsizeof-array-argument, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wsizeof-array-argument" ,, -Werror)
57+
AX_CHECK_COMPILE_FLAG(-Wstring-conversion, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wstring-conversion" ,, -Werror)
58+
AX_CHECK_COMPILE_FLAG(-Wno-variadic-macros, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-variadic-macros" ,, -Werror)
59+
AX_CHECK_COMPILE_FLAG(-Wno-sign-compare, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-sign-compare" ,, -Werror)
60+
AX_CHECK_COMPILE_FLAG(-fstack-protector, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -fstack-protector" ,, -Werror)
61+
AX_CHECK_COMPILE_FLAG(-fno-exceptions, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -fno-exceptions" ,, -Werror)
62+
AX_CHECK_COMPILE_FLAG(-Wformat-security, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wformat-security" ,, -Werror)
63+
AX_CHECK_COMPILE_FLAG(-Wformat-nonliteral, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wformat-nonliteral" ,, -Werror)
64+
AX_CHECK_COMPILE_FLAG(-Winit-self, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Winit-self" ,, -Werror)
65+
AX_CHECK_COMPILE_FLAG(-Wwrite-strings, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wwrite-strings" ,, -Werror)
66+
AX_CHECK_COMPILE_FLAG(-Wenum-compare, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wenum-compare" ,, -Werror)
67+
AX_CHECK_COMPILE_FLAG(-Wempty-body, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wempty-body" ,, -Werror)
68+
AX_CHECK_COMPILE_FLAG(-Wparentheses, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wparentheses" ,, -Werror)
69+
AX_CHECK_COMPILE_FLAG(-Wdeclaration-after-statement, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wdeclaration-after-statement" ,, -Werror)
70+
AX_CHECK_COMPILE_FLAG(-Wmaybe-uninitialized, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wmaybe-uninitialized" ,, -Werror)
71+
AX_CHECK_COMPILE_FLAG(-Wimplicit-fallthrough, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wimplicit-fallthrough" ,, -Werror)
72+
AX_CHECK_COMPILE_FLAG(-Werror, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Werror" ,, -Werror)
73+
AX_CHECK_COMPILE_FLAG(-Wextra, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wextra" ,, -Werror)
74+
AX_CHECK_COMPILE_FLAG(-Wno-unused-parameter, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-unused-parameter" ,, -Werror)
75+
AX_CHECK_COMPILE_FLAG(-Wno-unused-but-set-variable, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-unused-but-set-variable" ,, -Werror)
76+
AX_CHECK_COMPILE_FLAG(-Wno-missing-field-initializers, _MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS -Wno-missing-field-initializers",, -Werror)
7777

7878
MAINTAINER_CFLAGS="$_MAINTAINER_CFLAGS"
7979
STD_CFLAGS="-g -O0 -Wall"

phongo_compat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ void phongo_add_exception_prop(const char* prop, int prop_len, zval* value)
2222
if (EG(exception)) {
2323
zval ex;
2424
ZVAL_OBJ(&ex, EG(exception));
25-
zend_update_property(Z_OBJCE(ex), &ex, prop, prop_len, value);
25+
zend_update_property(Z_OBJCE(ex), PHONGO_COMPAT_OBJ_P(&ex), prop, prop_len, value);
2626
}
2727
}
2828

phongo_compat.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,19 @@
5858
#define PHONGO_BREAK_INTENTIONALLY_MISSING
5959
#endif
6060

61+
#if PHP_VERSION_ID >= 80000
62+
#define PHONGO_COMPAT_OBJ_P(val) Z_OBJ_P(val)
63+
#define phongo_compat_object_handler_type zend_object
64+
#define PHONGO_COMPAT_GET_OBJ(val) val
65+
#define PHONGO_COMPAT_SET_COMPARE_OBJECTS_HANDLER(type) php_phongo_handler_##type.compare = php_phongo_##type##_compare_objects;
66+
#else /* PHP_VERSION_ID < 80000 */
67+
#define PHONGO_COMPAT_OBJ_P(val) val
68+
#define phongo_compat_object_handler_type zval
69+
#define PHONGO_COMPAT_GET_OBJ(val) Z_OBJ_P(val)
70+
#define PHONGO_COMPAT_SET_COMPARE_OBJECTS_HANDLER(type) php_phongo_handler_##type.compare_objects = php_phongo_##type##_compare_objects;
71+
#define ZEND_COMPARE_OBJECTS_FALLBACK(o1, o2)
72+
#endif /* PHP_VERSION_ID >= 80000 */
73+
6174
#if SIZEOF_ZEND_LONG == 8
6275
#define PHONGO_LONG_FORMAT PRId64
6376
#elif SIZEOF_ZEND_LONG == 4

php_phongo.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2324,7 +2324,7 @@ static void php_phongo_dispatch_handlers(const char* name, zval* z_event)
23242324
* does a sizeof() on the name argument, which does only work with
23252325
* constant names, but not with parameterized ones as it does
23262326
* "sizeof(char*)" in that case. */
2327-
zend_call_method(value, NULL, NULL, name, strlen(name), NULL, 1, z_event, NULL);
2327+
zend_call_method(PHONGO_COMPAT_OBJ_P(value), NULL, NULL, name, strlen(name), NULL, 1, z_event, NULL);
23282328
}
23292329
ZEND_HASH_FOREACH_END();
23302330
}
@@ -2410,8 +2410,8 @@ static void php_phongo_command_failed(const mongoc_apm_command_failed_t* event)
24102410
mongoc_apm_command_failed_get_error(event, &tmp_error);
24112411

24122412
object_init_ex(&p_event->z_error, phongo_exception_from_mongoc_domain(tmp_error.domain, tmp_error.code));
2413-
zend_update_property_string(default_exception_ce, &p_event->z_error, ZEND_STRL("message"), tmp_error.message);
2414-
zend_update_property_long(default_exception_ce, &p_event->z_error, ZEND_STRL("code"), tmp_error.code);
2413+
zend_update_property_string(default_exception_ce, PHONGO_COMPAT_OBJ_P(&p_event->z_error), ZEND_STRL("message"), tmp_error.message);
2414+
zend_update_property_long(default_exception_ce, PHONGO_COMPAT_OBJ_P(&p_event->z_error), ZEND_STRL("code"), tmp_error.code);
24152415

24162416
php_phongo_dispatch_handlers("commandFailed", &z_event);
24172417
zval_ptr_dtor(&z_event);
@@ -2553,7 +2553,7 @@ static bool php_phongo_extract_handshake_data(zval* driver, const char* key, cha
25532553
zvalue = php_array_fetch(driver, key);
25542554

25552555
if (Z_TYPE_P(zvalue) != IS_STRING) {
2556-
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT TSRMLS_CC, "Expected \"%s\" handshake option to be a string, %s given", key, PHONGO_ZVAL_CLASS_OR_TYPE_NAME_P(zvalue));
2556+
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT, "Expected \"%s\" handshake option to be a string, %s given", key, PHONGO_ZVAL_CLASS_OR_TYPE_NAME_P(zvalue));
25572557
return false;
25582558
}
25592559

@@ -2628,7 +2628,7 @@ static void php_phongo_set_handshake_data(zval* driverOptions)
26282628
zval* driver = php_array_fetchc(driverOptions, "driver");
26292629

26302630
if (Z_TYPE_P(driver) != IS_ARRAY) {
2631-
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT TSRMLS_CC, "Expected \"driver\" driver option to be an array, %s given", PHONGO_ZVAL_CLASS_OR_TYPE_NAME_P(driver));
2631+
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT, "Expected \"driver\" driver option to be an array, %s given", PHONGO_ZVAL_CLASS_OR_TYPE_NAME_P(driver));
26322632
return;
26332633
}
26342634

@@ -3513,7 +3513,7 @@ PHP_GINIT_FUNCTION(mongodb)
35133513
mongodb_globals->bsonMemVTable = bsonMemVTable;
35143514

35153515
/* Initialize HashTable for persistent clients */
3516-
zend_hash_init_ex(&mongodb_globals->pclients, 0, NULL, NULL, 1, 0);
3516+
zend_hash_init(&mongodb_globals->pclients, 0, NULL, NULL, 1);
35173517
}
35183518
/* }}} */
35193519

@@ -3528,7 +3528,7 @@ static zend_class_entry* php_phongo_fetch_internal_class(const char* class_name,
35283528
return NULL;
35293529
}
35303530

3531-
static HashTable* php_phongo_std_get_gc(zval* object, zval** table, int* n) /* {{{ */
3531+
static HashTable* php_phongo_std_get_gc(phongo_compat_object_handler_type* object, zval** table, int* n) /* {{{ */
35323532
{
35333533
*table = NULL;
35343534
*n = 0;

src/BSON/Binary.c

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -312,14 +312,14 @@ static zend_object* php_phongo_binary_create_object(zend_class_entry* class_type
312312
return &intern->std;
313313
} /* }}} */
314314

315-
static zend_object* php_phongo_binary_clone_object(zval* object) /* {{{ */
315+
static zend_object* php_phongo_binary_clone_object(phongo_compat_object_handler_type* object) /* {{{ */
316316
{
317317
php_phongo_binary_t* intern;
318318
php_phongo_binary_t* new_intern;
319319
zend_object* new_object;
320320

321-
intern = Z_BINARY_OBJ_P(object);
322-
new_object = php_phongo_binary_create_object(Z_OBJCE_P(object));
321+
intern = Z_OBJ_BINARY(PHONGO_COMPAT_GET_OBJ(object));
322+
new_object = php_phongo_binary_create_object(PHONGO_COMPAT_GET_OBJ(object)->ce);
323323

324324
new_intern = Z_OBJ_BINARY(new_object);
325325
zend_objects_clone_members(&new_intern->std, &intern->std);
@@ -333,6 +333,8 @@ static int php_phongo_binary_compare_objects(zval* o1, zval* o2) /* {{{ */
333333
{
334334
php_phongo_binary_t *intern1, *intern2;
335335

336+
ZEND_COMPARE_OBJECTS_FALLBACK(o1, o2);
337+
336338
intern1 = Z_BINARY_OBJ_P(o1);
337339
intern2 = Z_BINARY_OBJ_P(o2);
338340

@@ -349,12 +351,12 @@ static int php_phongo_binary_compare_objects(zval* o1, zval* o2) /* {{{ */
349351
return zend_binary_strcmp(intern1->data, intern1->data_len, intern2->data, intern2->data_len);
350352
} /* }}} */
351353

352-
static HashTable* php_phongo_binary_get_properties_hash(zval* object, bool is_debug) /* {{{ */
354+
static HashTable* php_phongo_binary_get_properties_hash(phongo_compat_object_handler_type* object, bool is_debug) /* {{{ */
353355
{
354356
php_phongo_binary_t* intern;
355357
HashTable* props;
356358

357-
intern = Z_BINARY_OBJ_P(object);
359+
intern = Z_OBJ_BINARY(PHONGO_COMPAT_GET_OBJ(object));
358360

359361
PHONGO_GET_PROPERTY_HASH_INIT_PROPS(is_debug, intern, props, 2);
360362

@@ -375,13 +377,13 @@ static HashTable* php_phongo_binary_get_properties_hash(zval* object, bool is_de
375377
return props;
376378
} /* }}} */
377379

378-
static HashTable* php_phongo_binary_get_debug_info(zval* object, int* is_temp) /* {{{ */
380+
static HashTable* php_phongo_binary_get_debug_info(phongo_compat_object_handler_type* object, int* is_temp) /* {{{ */
379381
{
380382
*is_temp = 1;
381383
return php_phongo_binary_get_properties_hash(object, true);
382384
} /* }}} */
383385

384-
static HashTable* php_phongo_binary_get_properties(zval* object) /* {{{ */
386+
static HashTable* php_phongo_binary_get_properties(phongo_compat_object_handler_type* object) /* {{{ */
385387
{
386388
return php_phongo_binary_get_properties_hash(object, false);
387389
} /* }}} */
@@ -402,12 +404,12 @@ void php_phongo_binary_init_ce(INIT_FUNC_ARGS) /* {{{ */
402404
zend_class_implements(php_phongo_binary_ce, 1, zend_ce_serializable);
403405

404406
memcpy(&php_phongo_handler_binary, phongo_get_std_object_handlers(), sizeof(zend_object_handlers));
405-
php_phongo_handler_binary.clone_obj = php_phongo_binary_clone_object;
406-
php_phongo_handler_binary.compare_objects = php_phongo_binary_compare_objects;
407-
php_phongo_handler_binary.get_debug_info = php_phongo_binary_get_debug_info;
408-
php_phongo_handler_binary.get_properties = php_phongo_binary_get_properties;
409-
php_phongo_handler_binary.free_obj = php_phongo_binary_free_object;
410-
php_phongo_handler_binary.offset = XtOffsetOf(php_phongo_binary_t, std);
407+
PHONGO_COMPAT_SET_COMPARE_OBJECTS_HANDLER(binary);
408+
php_phongo_handler_binary.clone_obj = php_phongo_binary_clone_object;
409+
php_phongo_handler_binary.get_debug_info = php_phongo_binary_get_debug_info;
410+
php_phongo_handler_binary.get_properties = php_phongo_binary_get_properties;
411+
php_phongo_handler_binary.free_obj = php_phongo_binary_free_object;
412+
php_phongo_handler_binary.offset = XtOffsetOf(php_phongo_binary_t, std);
411413

412414
zend_declare_class_constant_long(php_phongo_binary_ce, ZEND_STRL("TYPE_GENERIC"), BSON_SUBTYPE_BINARY);
413415
zend_declare_class_constant_long(php_phongo_binary_ce, ZEND_STRL("TYPE_FUNCTION"), BSON_SUBTYPE_FUNCTION);

0 commit comments

Comments
 (0)