]> granicus.if.org Git - php/commitdiff
Use zend_objects_not_comparable in PDO
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 15 Mar 2021 12:01:42 +0000 (13:01 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 15 Mar 2021 12:01:42 +0000 (13:01 +0100)
ext/pdo/pdo_dbh.c
ext/pdo/pdo_stmt.c

index 3ef312cbe036182cebef4c73f743a8bd35a4c7d1..316c9e3f97414093d9b554308e3295cd9ae486c6 100644 (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);
index 1cb7bfd65c41c74b0155642d5e21a2f74f09a1e1..d630c31aef8296d0fcc34e3d679296a2a50a942c 100644 (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;
 }