Skip to content

Commit f7751f2

Browse files
committed
Use zend_objects_not_comparable in PDO
1 parent 8573eb9 commit f7751f2

File tree

2 files changed

+3
-18
lines changed

2 files changed

+3
-18
lines changed

ext/pdo/pdo_dbh.c

+1-6
Original file line numberDiff line numberDiff line change
@@ -1267,11 +1267,6 @@ static zend_function *dbh_method_get(zend_object **object, zend_string *method_n
12671267
return fbc;
12681268
}
12691269

1270-
static int dbh_compare(zval *object1, zval *object2)
1271-
{
1272-
return ZEND_UNCOMPARABLE;
1273-
}
1274-
12751270
static HashTable *dbh_get_gc(zend_object *object, zval **gc_data, int *gc_count)
12761271
{
12771272
pdo_dbh_t *dbh = php_pdo_dbh_fetch_inner(object);
@@ -1300,7 +1295,7 @@ void pdo_dbh_init(void)
13001295
pdo_dbh_object_handlers.free_obj = pdo_dbh_free_storage;
13011296
pdo_dbh_object_handlers.clone_obj = NULL;
13021297
pdo_dbh_object_handlers.get_method = dbh_method_get;
1303-
pdo_dbh_object_handlers.compare = dbh_compare;
1298+
pdo_dbh_object_handlers.compare = zend_objects_not_comparable;
13041299
pdo_dbh_object_handlers.get_gc = dbh_get_gc;
13051300

13061301
REGISTER_PDO_CLASS_CONST_LONG("PARAM_BOOL", (zend_long)PDO_PARAM_BOOL);

ext/pdo/pdo_stmt.c

+2-12
Original file line numberDiff line numberDiff line change
@@ -2072,11 +2072,6 @@ static zend_function *dbstmt_method_get(zend_object **object_pp, zend_string *me
20722072
return fbc;
20732073
}
20742074

2075-
static int dbstmt_compare(zval *object1, zval *object2)
2076-
{
2077-
return ZEND_UNCOMPARABLE;
2078-
}
2079-
20802075
zend_object_handlers pdo_dbstmt_object_handlers;
20812076
zend_object_handlers pdo_row_object_handlers;
20822077

@@ -2474,11 +2469,6 @@ static zend_string *row_get_classname(const zend_object *object)
24742469
return zend_string_init("PDORow", sizeof("PDORow") - 1, 0);
24752470
}
24762471

2477-
static int row_compare(zval *object1, zval *object2)
2478-
{
2479-
return ZEND_UNCOMPARABLE;
2480-
}
2481-
24822472
void pdo_row_free_storage(zend_object *std)
24832473
{
24842474
pdo_row_t *row = (pdo_row_t *)std;
@@ -2512,7 +2502,7 @@ void pdo_stmt_init(void)
25122502
pdo_dbstmt_object_handlers.write_property = dbstmt_prop_write;
25132503
pdo_dbstmt_object_handlers.unset_property = dbstmt_prop_delete;
25142504
pdo_dbstmt_object_handlers.get_method = dbstmt_method_get;
2515-
pdo_dbstmt_object_handlers.compare = dbstmt_compare;
2505+
pdo_dbstmt_object_handlers.compare = zend_objects_not_comparable;
25162506
pdo_dbstmt_object_handlers.clone_obj = NULL;
25172507

25182508
pdo_row_ce = register_class_PDORow();
@@ -2536,5 +2526,5 @@ void pdo_stmt_init(void)
25362526
pdo_row_object_handlers.get_method = row_method_get;
25372527
pdo_row_object_handlers.get_constructor = row_get_ctor;
25382528
pdo_row_object_handlers.get_class_name = row_get_classname;
2539-
pdo_row_object_handlers.compare = row_compare;
2529+
pdo_row_object_handlers.compare = zend_objects_not_comparable;
25402530
}

0 commit comments

Comments
 (0)