Skip to content
Open
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
2 changes: 1 addition & 1 deletion ext/zip/php_zip.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions ext/zip/php_zip_arginfo.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions ext/zip/tests/zip_entry_close_return_type.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
--TEST--
zip_entry_close(): declared return type matches the only possible outcome
--EXTENSIONS--
zip
--FILE--
<?php

$function = new ReflectionFunction('zip_entry_close');
var_dump((string) $function->getReturnType());

/* zip_entry_open() can genuinely report failure and keeps its bool */
$function = new ReflectionFunction('zip_entry_open');
var_dump((string) $function->getReturnType());

?>
--EXPECT--
string(4) "true"
string(4) "bool"
Loading