Skip to content

Commit

Permalink
Add null as a possible type parameter to strval (vimeo#4100)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
lhchavez authored and danog committed Jan 29, 2021
1 parent ee029a6 commit d1a42f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Psalm/Internal/Stubs/CoreGenericFunctions.phpstub
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ function bcdiv(string $left_operand, string $right_operand, int $scale = 0): ?st
/**
* @psalm-pure
*
* @param scalar|object $var
* @param scalar|null|object $var
* @return string The string value of var.
*
* @psalm-flow ($var) -> return
Expand Down

0 comments on commit d1a42f6

Please sign in to comment.