Use zend_objects_not_comparable in PDO

This commit is contained in:
Nikita Popov 2021-03-15 13:01:42 +01:00
parent 8573eb9e5c
commit f7751f2d8b
2 changed files with 3 additions and 18 deletions

View File

@ -1267,11 +1267,6 @@ out:
return fbc;
}
static int dbh_compare(zval *object1, zval *object2)
{
return ZEND_UNCOMPARABLE;
}
static HashTable *dbh_get_gc(zend_object *object, zval **gc_data, int *gc_count)
{
pdo_dbh_t *dbh = php_pdo_dbh_fetch_inner(object);
@ -1300,7 +1295,7 @@ void pdo_dbh_init(void)
pdo_dbh_object_handlers.free_obj = pdo_dbh_free_storage;
pdo_dbh_object_handlers.clone_obj = NULL;
pdo_dbh_object_handlers.get_method = dbh_method_get;
pdo_dbh_object_handlers.compare = dbh_compare;
pdo_dbh_object_handlers.compare = zend_objects_not_comparable;
pdo_dbh_object_handlers.get_gc = dbh_get_gc;
REGISTER_PDO_CLASS_CONST_LONG("PARAM_BOOL", (zend_long)PDO_PARAM_BOOL);

View File

@ -2072,11 +2072,6 @@ out:
return fbc;
}
static int dbstmt_compare(zval *object1, zval *object2)
{
return ZEND_UNCOMPARABLE;
}
zend_object_handlers pdo_dbstmt_object_handlers;
zend_object_handlers pdo_row_object_handlers;
@ -2474,11 +2469,6 @@ static zend_string *row_get_classname(const zend_object *object)
return zend_string_init("PDORow", sizeof("PDORow") - 1, 0);
}
static int row_compare(zval *object1, zval *object2)
{
return ZEND_UNCOMPARABLE;
}
void pdo_row_free_storage(zend_object *std)
{
pdo_row_t *row = (pdo_row_t *)std;
@ -2512,7 +2502,7 @@ void pdo_stmt_init(void)
pdo_dbstmt_object_handlers.write_property = dbstmt_prop_write;
pdo_dbstmt_object_handlers.unset_property = dbstmt_prop_delete;
pdo_dbstmt_object_handlers.get_method = dbstmt_method_get;
pdo_dbstmt_object_handlers.compare = dbstmt_compare;
pdo_dbstmt_object_handlers.compare = zend_objects_not_comparable;
pdo_dbstmt_object_handlers.clone_obj = NULL;
pdo_row_ce = register_class_PDORow();
@ -2536,5 +2526,5 @@ void pdo_stmt_init(void)
pdo_row_object_handlers.get_method = row_method_get;
pdo_row_object_handlers.get_constructor = row_get_ctor;
pdo_row_object_handlers.get_class_name = row_get_classname;
pdo_row_object_handlers.compare = row_compare;
pdo_row_object_handlers.compare = zend_objects_not_comparable;
}