summaryrefslogtreecommitdiff
path: root/ext/sockets
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/sockets
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/sockets')
-rw-r--r--ext/sockets/sockets.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c
index 368e61b0ed..16ad3e8013 100644
--- a/ext/sockets/sockets.c
+++ b/ext/sockets/sockets.c
@@ -461,6 +461,7 @@ static PHP_MINIT_FUNCTION(sockets)
address_info_object_handlers.free_obj = address_info_free_obj;
address_info_object_handlers.get_constructor = address_info_get_constructor;
address_info_object_handlers.clone_obj = NULL;
+ address_info_object_handlers.compare = zend_objects_not_comparable;
REGISTER_LONG_CONSTANT("AF_UNIX", AF_UNIX, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("AF_INET", AF_INET, CONST_CS | CONST_PERSISTENT);