Skip to content
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

Remove type coercion #298

Merged
merged 1 commit into from
Nov 28, 2023
Merged

Remove type coercion #298

merged 1 commit into from
Nov 28, 2023

Conversation

danog
Copy link
Collaborator

@danog danog commented Nov 28, 2023

No description provided.

@danog danog merged commit 950ea62 into master Nov 28, 2023
@danog danog mentioned this pull request Nov 28, 2023
@joehoyle
Copy link
Collaborator

@danog I just discovered this when upgrading to 0.12.0. This seems like a kinda major BC break as it effectively makes all #[php_function]s now strictly typed. Do we have a recommended way to handle type coercion ala PHP non-scrict behaviour?

@joehoyle joehoyle deleted the rm_double_type_coercion branch November 26, 2024 19:34
@Xenira
Copy link
Collaborator

Xenira commented Nov 26, 2024

A question would be if we even want to support this.

I do not like that php does this and if documented I would be fine with sticking to strict types.

@joehoyle
Copy link
Collaborator

I think it's probably a better default indeed, PHP type coercion is also context-dependant I believe too. Perhaps we could have zval.try_into_type() or something where we could have some convenience methods.

@danog
Copy link
Collaborator Author

danog commented Nov 27, 2024

Yeah this is a BC break, which is why I released a major.
I believe it's better to default to strict_types behavior, and I don't think it's a good idea to provide coercion methods, as we can coerce using directly rust...

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.

3 participants