[PHP-CVS] [php-src] master: ext/zip: declare true as the return type of zip_entry_close() (#23395)
[email protected] (Louis-Arnaud via GitHub)
| Newsgroups | php.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: Louis-Arnaud (lacatoire)
Committer: GitHub (web-flow)
Pusher: LamentXU123
Date: 2026-08-21T21:59:42+08:00
Commit: https://github.com/php/php-src/commit/3a710fa7cb85d14e7296fea02a043536b4aa2eee
Raw diff: https://github.com/php/php-src/commit/3a710fa7cb85d14e7296fea02a043536b4aa2eee.diff
ext/zip: declare true as the return type of zip_entry_close() (#23395)
The function has two exits: RETURN_THROWS for a bad parameter or a
stale resource, and an unconditional RETURN_TRUE after closing the
entry. Nothing returns false.
Changed paths:
M ext/zip/php_zip.stub.php
M ext/zip/php_zip_arginfo.h
Diff:
diff --git a/ext/zip/php_zip.stub.php b/ext/zip/php_zip.stub.php
index 2cece2791d1b..60fc47abfcfc 100644
--- a/ext/zip/php_zip.stub.php
+++ b/ext/zip/php_zip.stub.php
@@ -32,7 +32,7 @@ function zip_entry_open($zip_dp, $zip_entry, string $mode = "rb"): bool {}
* @param resource $zip_entry
*/
#[\Deprecated(since: '8.0')]
-function zip_entry_close($zip_entry): bool {}
+function zip_entry_close($zip_entry): true {}
/**
* @param resource $zip_entry
diff --git a/ext/zip/php_zip_arginfo.h b/ext/zip/php_zip_arginfo.h
index 4f8366dc1512..2496670158da 100644
--- a/ext/zip/php_zip_arginfo.h
+++ b/ext/zip/php_zip_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit php_zip.stub.php instead.
- * Stub hash: 206d9be6640ee7e94d68d7e075ab61bf3188cab3 */
+ * Stub hash: 8f2b42d73dd8ff8729ddeff8396fa6d563eb13cb */
ZEND_BEGIN_ARG_INFO_EX(arginfo_zip_open, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)
@@ -19,7 +19,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zip_entry_open, 0, 2, _IS_BOOL,
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_STRING, 0, "\"rb\"")
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zip_entry_close, 0, 1, _IS_BOOL, 0)
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zip_entry_close, 0, 1, IS_TRUE, 0)
ZEND_ARG_INFO(0, zip_entry)
ZEND_END_ARG_INFO()