Skip to content

Fix type for index in ZipArchive::replaceFile #8481

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed

Fix type for index in ZipArchive::replaceFile #8481

wants to merge 2 commits into from

Conversation

kingkero
Copy link
Contributor

@kingkero kingkero commented May 2, 2022

see php/doc-en#1563

In all of the ZipArchive methods, the index is always described as int (see https://www.php.net/manual/en/class.ziparchive.php). Only for the replaceFile it is documented as string. However, actually passing a string will trigger (in PHP 8.1.5)

Fatal error: Uncaught TypeError: ZipArchive::replaceFile(): Argument php/doc-en#2 ($index) must be of type int, string given

TypeError: ZipArchive::replaceFile(): Argument php/doc-en#2 ($index) must be of type int, string given

@remicollet
Copy link
Member

Squashed and merged in 8.0 as 389d113

@remicollet remicollet closed this May 2, 2022
@kingkero kingkero deleted the fix-type-ziparchive-replaceFile branch May 2, 2022 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants