Skip to content

Conversation

@staabm
Copy link
Contributor

@staabm staabm commented Dec 4, 2025

since PHP8.5 there is also CurlSharePersistentHandle created via curl_share_init_persistent

Comment on lines 1219 to 1220
new ResourceType(), // PHP 7.x
new ObjectType('CurlShareHandle'), // since PHP 8.0
new ObjectType('CurlSharePersistentHandle'), // since PHP 8.5
Copy link
Contributor Author

@staabm staabm Dec 4, 2025

Choose a reason for hiding this comment

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

we don't have access to PhpVersion at this point, therefore I hardcoded all possible types.
I think it doesn't really matter to narrow this further, because the values will be created by php-src builtin functions, so cannot be wrongly instantiated at runtime.

return new UnionType([
new ResourceType(), // PHP 7.x
new ObjectType('CurlShareHandle'), // since PHP 8.0
new ObjectType('CurlSharePersistentHandle'), // since PHP 8.5
Copy link
Member

Choose a reason for hiding this comment

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

You can ask PhpVersionStaticAccessor.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

adjusted, thanks

@ondrejmirtes ondrejmirtes merged commit 5e1657b into phpstan:2.1.x Dec 5, 2025
632 of 636 checks passed
@ondrejmirtes
Copy link
Member

Thank you!

@staabm staabm deleted the curl85 branch December 5, 2025 09:50
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