MYSQLI_RESOURCE *my_res;
mysqli_object *intern = Z_MYSQLI_P(elem);
if (!(my_res = (MYSQLI_RESOURCE *)intern->ptr)) {
- zend_throw_error(NULL, "%s object is already closed", ZSTR_VAL(intern->zo.ce->name));
+ zend_throw_error(NULL, "%s object is already closed", ZSTR_VAL(intern->zo.ce->name));
return FAILURE;
}
mysql = (MY_MYSQL*) my_res->ptr;
MYSQLND **p = in_array;
zval dest_array;
zval *elem, *dest_elem;
- int ret = 0, i = 0;
+ int ret = 0;
array_init_size(&dest_array, zend_hash_num_elements(Z_ARRVAL_P(out_array)));
ZEND_HASH_FOREACH_VAL(Z_ARRVAL_P(out_array), elem) {
- i++;
if (Z_TYPE_P(elem) != IS_OBJECT ||
!instanceof_function(Z_OBJCE_P(elem), mysqli_link_class_entry)) {
continue;
MYSQLI_RESOURCE *my_res;
mysqli_object *intern = Z_MYSQLI_P(elem);
if (!(my_res = (MYSQLI_RESOURCE *)intern->ptr)) {
- php_error_docref(NULL, E_WARNING, "[%d] Couldn't fetch %s", i, ZSTR_VAL(intern->zo.ce->name));
- continue;
+ zend_throw_error(NULL, "%s object is already closed", ZSTR_VAL(intern->zo.ce->name));
+ return FAILURE;
}
mysql = (MY_MYSQL *) my_res->ptr;
if (mysql->mysql == *p) {
if (e_array != NULL) {
if (mysqlnd_zval_array_to_mysqlnd_array(e_array, &new_e_array) == FAILURE) {
efree(new_e_array);
+ efree(new_r_array);
RETURN_THROWS();
}
}
if (!obj->ptr || !((MYSQLI_RESOURCE *)(obj->ptr))->ptr) {
if (!quiet) {
- zend_throw_error(NULL, "Couldn't fetch %s", ZSTR_VAL(obj->zo.ce->name));
+ zend_throw_error(NULL, "%s object is already closed", ZSTR_VAL(obj->zo.ce->name));
}
return FAILURE;
if (!obj->ptr || !((MYSQLI_RESOURCE *)(obj->ptr))->ptr) {
if (!quiet) {
- zend_throw_error(NULL, "Couldn't fetch %s", ZSTR_VAL(obj->zo.ce->name));
+ zend_throw_error(NULL, "%s object is already closed", ZSTR_VAL(obj->zo.ce->name));
}
return FAILURE;
if (!obj->ptr || !((MYSQLI_RESOURCE *)(obj->ptr))->ptr) {
if (!quiet) {
- zend_throw_error(NULL, "Couldn't fetch %s", ZSTR_VAL(obj->zo.ce->name));
+ zend_throw_error(NULL, "%s object is already closed", ZSTR_VAL(obj->zo.ce->name));
}
return FAILURE;
echo $e->getMessage() . \PHP_EOL;
}
+ $link->close();
+ $read[0] = get_connection();
+ try {
+ mysqli_poll($read, $error, $reject, 0, 1);
+ } catch (\Error $e) {
+ echo $e->getMessage() . \PHP_EOL;
+ }
+
function poll_async($offset, $link, $links, $errors, $reject, $exp_ready, $use_oo_syntax) {
if ($exp_ready !== ($tmp = mysqli_poll($links, $errors, $reject, 0, 1000)))
--EXPECTF--
mysqli_poll(): Argument #4 ($seconds) must be greater than or equal to 0
mysqli_poll(): Argument #5 ($microseconds) must be greater than or equal to 0
+mysqli object is already closed
[012 + 6] Rejecting thread %d: 0/
[013 + 6] Rejecting thread %d: 0/
[014 + 6] Rejecting thread %d: 0/