Skip to content

Fix GH-24289: finfo::file() reports the wrong argument number - #24290

Open
lazerg wants to merge 2 commits into
php:PHP-8.4from
lazerg:fix/gh-24289
Open

lazerg wants to merge 2 commits into
php:PHP-8.4from
lazerg:fix/gh-24289

Conversation

@lazerg

@lazerg lazerg commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

finfo_file() and finfo::file() share one implementation, and on PHP-8.4 the argument number for the empty and null byte checks is only switched for mime_content_type(). So the method reports Argument #2 ($flags) while $filename is argument 1 there. This uses 1 when called as a method too.

PHP-8.5 and master hardcode 2 for the empty check in finfo_file() instead, so that part will need adjusting on merge up.

Fixes GH-24289

@ndossche

ndossche commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Use hasThis instead of getThis

@lazerg

lazerg commented Oct 13, 2026

Copy link
Copy Markdown
Contributor Author

Done in 5ffdb80.

@ndossche ndossche left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@ndossche ndossche self-assigned this Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

finfo::file(): empty $filename ValueError reports argument #2 ($flags)

2 participants