diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index a680cf46c34..443232894b2 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -675,12 +675,14 @@ void odbc_transact(INTERNAL_FUNCTION_PARAMETERS, int type) /* }}} */ /* {{{ _close_pconn_with_res */ -static int _close_pconn_with_res(zend_resource *le, zend_resource *res) +static int _close_pconn_with_res(zval *zv, void *p) { - if (le->type == le_pconn && (((odbc_connection *)(le->ptr))->res == res)){ - return 1; - }else{ - return 0; + zend_resource *le = Z_RES_P(zv); + zend_resource *res = (zend_resource*)p; + if (le->type == le_pconn && (((odbc_connection *)(le->ptr))->res == res)) { + return ZEND_HASH_APPLY_REMOVE; + } else { + return ZEND_HASH_APPLY_KEEP; } } /* }}} */ @@ -759,7 +761,7 @@ PHP_FUNCTION(odbc_close_all) zend_list_close(p); /* Delete the persistent connection */ zend_hash_apply_with_argument(&EG(persistent_list), - (apply_func_arg_t) _close_pconn_with_res, (void *)p); + _close_pconn_with_res, (void *)p); } } } ZEND_HASH_FOREACH_END(); @@ -2330,7 +2332,7 @@ PHP_FUNCTION(odbc_close) zend_list_close(Z_RES_P(pv_conn)); if(is_pconn){ - zend_hash_apply_with_argument(&EG(persistent_list), (apply_func_arg_t) _close_pconn_with_res, (void *) Z_RES_P(pv_conn)); + zend_hash_apply_with_argument(&EG(persistent_list), _close_pconn_with_res, (void *) Z_RES_P(pv_conn)); } } /* }}} */ diff --git a/ext/odbc/tests/config.inc b/ext/odbc/tests/config.inc index 78be4b2d99a..8d74feeb6ff 100644 --- a/ext/odbc/tests/config.inc +++ b/ext/odbc/tests/config.inc @@ -1,8 +1,5 @@ +--FILE-- + +--EXPECT-- +string(22) "PHP odbc_pconnect test" +string(22) "PHP odbc_pconnect test" +NULL