. Fixed bug #70091 (Phar does not mark UTF-8 filenames in ZIP archives). (cmb)
. Fixed bug #53467 (Phar cannot compress large archives). (cmb, lserni)
+- Socket:
+ . Fixed bug #80723 (Different sockets compare as equal (regression in 8.0)).
+ (Nikita)
+
- SPL:
. Fixed bug#80719 (Iterating after failed ArrayObject::setIteratorClass()
causes Segmentation fault). (Nikita)
}
/* }}} */
+ZEND_API int zend_objects_not_comparable(zval *o1, zval *o2)
+{
+ return ZEND_UNCOMPARABLE;
+}
+
ZEND_API int zend_std_has_property(zend_object *zobj, zend_string *name, int has_set_exists, void **cache_slot) /* {{{ */
{
int result;
ZEND_API int zend_std_get_closure(zend_object *obj, zend_class_entry **ce_ptr, zend_function **fptr_ptr, zend_object **obj_ptr, zend_bool check_only);
ZEND_API void rebuild_object_properties(zend_object *zobj);
+/* Handler for objects that cannot be meaningfully compared.
+ * Only objects with the same identity will be considered equal. */
+ZEND_API int zend_objects_not_comparable(zval *o1, zval *o2);
+
ZEND_API int zend_check_protected(zend_class_entry *ce, zend_class_entry *scope);
ZEND_API int zend_check_property_access(zend_object *zobj, zend_string *prop_info_name, zend_bool is_dynamic);
socket_object_handlers.get_constructor = socket_get_constructor;
socket_object_handlers.clone_obj = NULL;
socket_object_handlers.get_gc = socket_get_gc;
+ socket_object_handlers.compare = zend_objects_not_comparable;
zend_class_entry ce_address_info;
INIT_CLASS_ENTRY(ce_address_info, "AddressInfo", class_AddressInfo_methods);
--- /dev/null
+--TEST--
+Bug #80723: Different sockets compare as equal (regression in 8.0)
+--FILE--
+<?php
+$socket_1 = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
+$socket_2 = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
+var_dump($socket_1 == $socket_1);
+var_dump($socket_2 == $socket_2);
+var_dump($socket_1 == $socket_2);
+
+$vector = array(1 => $socket_1, 2 => $socket_2);
+var_dump(array_search($socket_1, $vector));
+var_dump(array_search($socket_2, $vector));
+
+?>
+--EXPECT--
+bool(true)
+bool(true)
+bool(false)
+int(1)
+int(2)