summaryrefslogtreecommitdiff
path: root/ext/zlib/zlib.c
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/zlib/zlib.c
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/zlib/zlib.c')
-rw-r--r--ext/zlib/zlib.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index eab3b02ca5..75bd273526 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -1350,6 +1350,7 @@ static PHP_MINIT_FUNCTION(zlib)
inflate_context_object_handlers.free_obj = inflate_context_free_obj;
inflate_context_object_handlers.get_constructor = inflate_context_get_constructor;
inflate_context_object_handlers.clone_obj = NULL;
+ inflate_context_object_handlers.compare = zend_objects_not_comparable;
zend_class_entry deflate_ce;
INIT_CLASS_ENTRY(deflate_ce, "DeflateContext", class_DeflateContext_methods);
@@ -1364,6 +1365,7 @@ static PHP_MINIT_FUNCTION(zlib)
deflate_context_object_handlers.free_obj = deflate_context_free_obj;
deflate_context_object_handlers.get_constructor = deflate_context_get_constructor;
deflate_context_object_handlers.clone_obj = NULL;
+ deflate_context_object_handlers.compare = zend_objects_not_comparable;
REGISTER_LONG_CONSTANT("FORCE_GZIP", PHP_ZLIB_ENCODING_GZIP, CONST_CS|CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("FORCE_DEFLATE", PHP_ZLIB_ENCODING_DEFLATE, CONST_CS|CONST_PERSISTENT);