Skip to content

fileinfo: Deprecate finfo_close() - #18396

Merged
Girgias merged 1 commit into
php:masterfrom
TimWolla:finfo-close-deprecate
Aug 8, 2025
Merged

fileinfo: Deprecate finfo_close()#18396
Girgias merged 1 commit into
php:masterfrom
TimWolla:finfo-close-deprecate

Conversation

@TimWolla

Copy link
Copy Markdown
Member

Does this need an RFC or can we do this by simple agreement? Requesting reviews from Girgias and the RMs 😄


This is for consistency with other *_close() functions that have become obsolete when migrating from resources to objects.

@DanielEScherzer

Copy link
Copy Markdown
Member

@TimWolla

Copy link
Copy Markdown
MemberAuthor

Thanks, I've linked this PR in the RFC as the implementation.

@Girgias

Copy link
Copy Markdown
Member

I think merging the test changes already is fine.

But having it in the bulk RFC is probably the "proper" way to do it, even if I would agree just deprecating it should be fine.

@TimWolla

Copy link
Copy Markdown
MemberAuthor

I think merging the test changes already is fine.

#18405.

@TimWolla
TimWollaforce-pushed the finfo-close-deprecate branch from 3ebec92 to bad3cefCompareApril 23, 2025 16:58
Comment threadext/fileinfo/fileinfo.stub.php Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
#[\Deprecated(since: '8.5', message: 'as finfo objects are freed automatically')]
#[\Deprecated(since: 'PHP 8.5', message: 'as finfo objects are freed automatically')]

Isn't it better to be explicit about the version? There may be case that the plain version number may be confused with other software, i.e. MySQL has close version number.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

This is a discussion for another place. The “bare version” format is what is currently used by PHP core. See: 29f98e7

@TimWolla
TimWollaforce-pushed the finfo-close-deprecate branch 2 times, most recently from 73f9287 to af4ac45CompareJuly 29, 2025 11:58
@TimWolla
TimWollaforce-pushed the finfo-close-deprecate branch from af4ac45 to 1d7568cCompareJuly 29, 2025 11:59
@Girgias
Girgias merged commit ccb716d into php:masterAug 8, 2025
9 checks passed
@TimWolla
TimWolla deleted the finfo-close-deprecate branch August 19, 2025 14:40
Sign up for freeto 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.

4 participants

@TimWolla@DanielEScherzer@Girgias@jorgsowa