Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ PHP NEWS
. Add new Uri\UriError exception that is thrown for internal error
conditions. (timwolla)
. Further clean up the internal API. (timwolla)
. Fixed bug GH-19892 (Refcounting on zend_empty_array). (ilutov, timwolla)

- Windows:
. Fix GH-19722 (_get_osfhandle asserts in debug mode when given a socket).
Expand Down
1 change: 1 addition & 0 deletions Zend/zend_API.h
Original file line number Diff line number Diff line change
Expand Up @@ -1364,6 +1364,7 @@ ZEND_API zend_result zend_try_assign_typed_ref_zval_ex(zend_reference *ref, zval

#define ZEND_TRY_ASSIGN_REF_ARR(zv, arr) do { \
ZEND_ASSERT(Z_ISREF_P(zv)); \
ZEND_ASSERT(!(GC_FLAGS(arr) & GC_IMMUTABLE)); \
_ZEND_TRY_ASSIGN_ARR(zv, arr, 1); \
} while (0)

Expand Down
2 changes: 1 addition & 1 deletion ext/uri/php_uri.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ static zend_result pass_errors_by_ref_and_free(zval *errors_zv, zval *errors)
return SUCCESS;
}

ZEND_TRY_ASSIGN_REF_ARR(errors_zv, Z_ARRVAL_P(errors));
ZEND_TRY_ASSIGN_REF_TMP(errors_zv, errors);
if (EG(exception)) {
return FAILURE;
}
Expand Down
12 changes: 12 additions & 0 deletions ext/uri/tests/gh19892.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--TEST--
GH-19892: Successful \Uri\WhatWg\Url::parse() with empty errors array
--FILE--
<?php

\Uri\WhatWg\Url::parse('https://example.com', errors: $errors);
var_dump($errors);

?>
--EXPECT--
array(0) {
}