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

Add null as a possible type parameter to strval #4100

Merged
merged 1 commit into from Sep 1, 2020

Conversation

lhchavez
Copy link
Contributor

@lhchavez lhchavez commented Sep 1, 2020

https://www.php.net/manual/en/language.types.string.php#language.types.string.casting mentions

NULL is always converted to an empty string.

Which seems to indicate that it is a valid argument for it.

As opposed to stringifying other types (like arrays), strval(null) does not cause a warning in PHP.

https://www.php.net/manual/en/language.types.string.php#language.types.string.casting mentions

> `NULL` is always converted to an empty string.

Which seems to indicate that it is a valid argument for it.

As opposed to stringifying other types (like arrays), `strval(null)` does not cause a warning in PHP.
@muglug muglug merged commit 8177792 into vimeo:master Sep 1, 2020
@muglug
Copy link
Collaborator

muglug commented Sep 1, 2020

Sure, thanks!

@lhchavez lhchavez deleted the patch-1 branch September 1, 2020 15:01
muglug pushed a commit that referenced this pull request Sep 1, 2020
https://www.php.net/manual/en/language.types.string.php#language.types.string.casting mentions

> `NULL` is always converted to an empty string.

Which seems to indicate that it is a valid argument for it.

As opposed to stringifying other types (like arrays), `strval(null)` does not cause a warning in PHP.
danog pushed a commit to danog/psalm that referenced this pull request Jan 29, 2021
https://www.php.net/manual/en/language.types.string.php#language.types.string.casting mentions

> `NULL` is always converted to an empty string.

Which seems to indicate that it is a valid argument for it.

As opposed to stringifying other types (like arrays), `strval(null)` does not cause a warning in PHP.
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.

None yet

2 participants