summaryrefslogtreecommitdiff
path: root/ext/enchant
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2021-02-16 14:20:45 +0100
committerNikita Popov <nikita.ppv@gmail.com>2021-02-16 14:20:45 +0100
commitb63ea1047a5c130231cec5571861f1dcdf63a063 (patch)
tree0fff21141ba410ca439833f64b41e86a1d22e2b4 /ext/enchant
parentcb9785add1bc8031531c2870c267e6a72efae6af (diff)
downloadphp-git-b63ea1047a5c130231cec5571861f1dcdf63a063.tar.gz
Mark resource-like objects as non-comparable
As these hold on to some internal resource, there can't be two "equal" objects with different identity. Make sure the lack of public properties doesn't result in these being treated as always equal.
Diffstat (limited to 'ext/enchant')
-rw-r--r--ext/enchant/enchant.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c
index 5661975820..b602620c2a 100644
--- a/ext/enchant/enchant.c
+++ b/ext/enchant/enchant.c
@@ -199,6 +199,7 @@ PHP_MINIT_FUNCTION(enchant)
enchant_broker_handlers.offset = XtOffsetOf(enchant_broker, std);
enchant_broker_handlers.free_obj = php_enchant_broker_free;
enchant_broker_handlers.clone_obj = NULL;
+ enchant_broker_handlers.compare = zend_objects_not_comparable;
INIT_CLASS_ENTRY(dce, "EnchantDictionary", class_EnchantDictionary_methods);
enchant_dict_ce = zend_register_internal_class(&dce);
@@ -211,6 +212,7 @@ PHP_MINIT_FUNCTION(enchant)
enchant_dict_handlers.offset = XtOffsetOf(enchant_dict, std);
enchant_dict_handlers.free_obj = php_enchant_dict_free;
enchant_dict_handlers.clone_obj = NULL;
+ enchant_dict_handlers.compare = zend_objects_not_comparable;
REGISTER_LONG_CONSTANT("ENCHANT_MYSPELL", PHP_ENCHANT_MYSPELL, CONST_CS | CONST_PERSISTENT | CONST_DEPRECATED);
REGISTER_LONG_CONSTANT("ENCHANT_ISPELL", PHP_ENCHANT_ISPELL, CONST_CS | CONST_PERSISTENT | CONST_DEPRECATED);